mancha 0.17.3 → 0.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +8 -8
- package/.prettierrc +2 -2
- package/.vscode/extensions.json +1 -1
- package/.vscode/launch.json +33 -43
- package/README.md +94 -94
- package/dist/browser.js.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/css_gen_basic.js.map +1 -1
- package/dist/css_gen_utils.d.ts +786 -0
- package/dist/css_gen_utils.js +63 -23
- package/dist/css_gen_utils.js.map +1 -1
- package/dist/dome.js.map +1 -1
- package/dist/expressions/ast.d.ts +16 -16
- package/dist/expressions/ast.test.js +89 -64
- package/dist/expressions/ast.test.js.map +1 -1
- package/dist/expressions/ast_factory.d.ts +1 -1
- package/dist/expressions/ast_factory.js +17 -17
- package/dist/expressions/ast_factory.js.map +1 -1
- package/dist/expressions/ast_factory.test.js +42 -36
- package/dist/expressions/ast_factory.test.js.map +1 -1
- package/dist/expressions/constants.js +56 -56
- package/dist/expressions/constants.js.map +1 -1
- package/dist/expressions/constants.test.js +57 -57
- package/dist/expressions/constants.test.js.map +1 -1
- package/dist/expressions/eval.d.ts +17 -17
- package/dist/expressions/eval.js +58 -60
- package/dist/expressions/eval.js.map +1 -1
- package/dist/expressions/eval.test.js +11 -8
- package/dist/expressions/eval.test.js.map +1 -1
- package/dist/expressions/expressions.test.d.ts +6 -6
- package/dist/expressions/expressions.test.js +6 -6
- package/dist/expressions/index.d.ts +6 -6
- package/dist/expressions/index.js +6 -6
- package/dist/expressions/parser.d.ts +3 -3
- package/dist/expressions/parser.js +37 -42
- package/dist/expressions/parser.js.map +1 -1
- package/dist/expressions/parser.test.js +3 -6
- package/dist/expressions/parser.test.js.map +1 -1
- package/dist/expressions/tokenizer.js +22 -25
- package/dist/expressions/tokenizer.js.map +1 -1
- package/dist/expressions/tokenizer.test.js +40 -15
- package/dist/expressions/tokenizer.test.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iterator.js.map +1 -1
- package/dist/mancha.js.map +1 -1
- package/dist/plugins.js +2 -2
- package/dist/plugins.js.map +1 -1
- package/dist/query.js.map +1 -1
- package/dist/renderer.js.map +1 -1
- package/dist/safe_browser.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/store.js.map +1 -1
- package/dist/test_utils.js.map +1 -1
- package/dist/trusted_attributes.js.map +1 -1
- package/dist/type_checker.js +11 -7
- package/dist/type_checker.js.map +1 -1
- package/dist/worker.js.map +1 -1
- package/docs/css.md +309 -0
- package/docs/quickstart.md +305 -296
- package/global.d.ts +2 -2
- package/gulpfile.ts +44 -0
- package/package.json +86 -84
- package/scripts/generate-css-docs.ts +263 -0
- package/tsconfig.json +42 -19
- package/tsec_exemptions.json +8 -3
- package/webpack.config.esmodule.ts +26 -0
- package/webpack.config.ts +21 -0
- package/gulpfile.js +0 -44
- package/webpack.config.esmodule.js +0 -23
- package/webpack.config.js +0 -18
|
@@ -2,71 +2,71 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
4
4
|
*/
|
|
5
|
-
export const KEYWORDS = new Set([
|
|
5
|
+
export const KEYWORDS = new Set(["this", "typeof"]);
|
|
6
6
|
// Word-based operators (alphabetic tokens that are operators, not keywords)
|
|
7
|
-
export const WORD_OPERATORS = new Set([
|
|
8
|
-
export const UNARY_OPERATORS = new Set([
|
|
7
|
+
export const WORD_OPERATORS = new Set(["in"]);
|
|
8
|
+
export const UNARY_OPERATORS = new Set(["+", "-", "!", "typeof"]);
|
|
9
9
|
export const BINARY_OPERATORS = new Set([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
"=",
|
|
11
|
+
"+",
|
|
12
|
+
"-",
|
|
13
|
+
"*",
|
|
14
|
+
"/",
|
|
15
|
+
"%",
|
|
16
|
+
"^",
|
|
17
|
+
"==",
|
|
18
|
+
"!=",
|
|
19
|
+
">",
|
|
20
|
+
"<",
|
|
21
|
+
">=",
|
|
22
|
+
"<=",
|
|
23
|
+
"||",
|
|
24
|
+
"&&",
|
|
25
|
+
"??",
|
|
26
|
+
"&",
|
|
27
|
+
"===",
|
|
28
|
+
"!==",
|
|
29
|
+
"|",
|
|
30
|
+
"in",
|
|
31
31
|
]);
|
|
32
32
|
export const PRECEDENCE = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
"!": 0,
|
|
34
|
+
":": 0,
|
|
35
|
+
",": 0,
|
|
36
|
+
")": 0,
|
|
37
|
+
"]": 0,
|
|
38
|
+
"}": 0,
|
|
39
|
+
"?": 2,
|
|
40
|
+
"??": 3,
|
|
41
|
+
"||": 4,
|
|
42
|
+
"&&": 5,
|
|
43
|
+
"|": 6,
|
|
44
|
+
"^": 7,
|
|
45
|
+
"&": 8,
|
|
46
46
|
// equality
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
"!=": 9,
|
|
48
|
+
"==": 9,
|
|
49
|
+
"!==": 9,
|
|
50
|
+
"===": 9,
|
|
51
51
|
// relational
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
">=": 10,
|
|
53
|
+
">": 10,
|
|
54
|
+
"<=": 10,
|
|
55
|
+
"<": 10,
|
|
56
|
+
in: 10,
|
|
57
57
|
// additive
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
"+": 11,
|
|
59
|
+
"-": 11,
|
|
60
60
|
// multiplicative
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
"%": 12,
|
|
62
|
+
"/": 12,
|
|
63
|
+
"*": 12,
|
|
64
64
|
// postfix
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
"(": 13,
|
|
66
|
+
"[": 13,
|
|
67
|
+
".": 13,
|
|
68
|
+
"?.": 13,
|
|
69
|
+
"{": 13, // not sure this is correct
|
|
70
70
|
};
|
|
71
71
|
export const POSTFIX_PRECEDENCE = 13;
|
|
72
72
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/expressions/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/expressions/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,eAA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,EAAE,EAAE,2BAA2B;CACpC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC"}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
import { assert } from "../test_utils.js";
|
|
2
|
-
import { KEYWORDS, WORD_OPERATORS, UNARY_OPERATORS, BINARY_OPERATORS, PRECEDENCE, POSTFIX_PRECEDENCE, } from
|
|
2
|
+
import { KEYWORDS, WORD_OPERATORS, UNARY_OPERATORS, BINARY_OPERATORS, PRECEDENCE, POSTFIX_PRECEDENCE, } from "./constants.js";
|
|
3
3
|
describe("Expression Constants", () => {
|
|
4
4
|
it("should define KEYWORDS correctly", () => {
|
|
5
|
-
assert.deepEqual(KEYWORDS, new Set([
|
|
5
|
+
assert.deepEqual(KEYWORDS, new Set(["this", "typeof"]));
|
|
6
6
|
});
|
|
7
7
|
it("should define WORD_OPERATORS correctly", () => {
|
|
8
|
-
assert.deepEqual(WORD_OPERATORS, new Set([
|
|
8
|
+
assert.deepEqual(WORD_OPERATORS, new Set(["in"]));
|
|
9
9
|
});
|
|
10
10
|
it("should define UNARY_OPERATORS correctly", () => {
|
|
11
|
-
assert.deepEqual(UNARY_OPERATORS, new Set([
|
|
11
|
+
assert.deepEqual(UNARY_OPERATORS, new Set(["+", "-", "!", "typeof"]));
|
|
12
12
|
});
|
|
13
13
|
it("should define BINARY_OPERATORS correctly", () => {
|
|
14
14
|
assert.deepEqual(BINARY_OPERATORS, new Set([
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
"=",
|
|
16
|
+
"+",
|
|
17
|
+
"-",
|
|
18
|
+
"*",
|
|
19
|
+
"/",
|
|
20
|
+
"%",
|
|
21
|
+
"^",
|
|
22
|
+
"==",
|
|
23
|
+
"!=",
|
|
24
|
+
">",
|
|
25
|
+
"<",
|
|
26
|
+
">=",
|
|
27
|
+
"<=",
|
|
28
|
+
"||",
|
|
29
|
+
"&&",
|
|
30
|
+
"??",
|
|
31
|
+
"&",
|
|
32
|
+
"===",
|
|
33
|
+
"!==",
|
|
34
|
+
"|",
|
|
35
|
+
"in",
|
|
36
36
|
]));
|
|
37
37
|
});
|
|
38
38
|
it("should define PRECEDENCE correctly", () => {
|
|
39
39
|
const expectedPrecedence = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
"!": 0,
|
|
41
|
+
":": 0,
|
|
42
|
+
",": 0,
|
|
43
|
+
")": 0,
|
|
44
|
+
"]": 0,
|
|
45
|
+
"}": 0,
|
|
46
|
+
"?": 2,
|
|
47
|
+
"??": 3,
|
|
48
|
+
"||": 4,
|
|
49
|
+
"&&": 5,
|
|
50
|
+
"|": 6,
|
|
51
|
+
"^": 7,
|
|
52
|
+
"&": 8,
|
|
53
53
|
// equality
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
"!=": 9,
|
|
55
|
+
"==": 9,
|
|
56
|
+
"!==": 9,
|
|
57
|
+
"===": 9,
|
|
58
58
|
// relational
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
">=": 10,
|
|
60
|
+
">": 10,
|
|
61
|
+
"<=": 10,
|
|
62
|
+
"<": 10,
|
|
63
|
+
in: 10,
|
|
64
64
|
// additive
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
"+": 11,
|
|
66
|
+
"-": 11,
|
|
67
67
|
// multiplicative
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
"%": 12,
|
|
69
|
+
"/": 12,
|
|
70
|
+
"*": 12,
|
|
71
71
|
// postfix
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
"(": 13,
|
|
73
|
+
"[": 13,
|
|
74
|
+
".": 13,
|
|
75
|
+
"?.": 13,
|
|
76
|
+
"{": 13,
|
|
77
77
|
};
|
|
78
78
|
assert.deepEqual(PRECEDENCE, expectedPrecedence);
|
|
79
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.test.js","sourceRoot":"","sources":["../../src/expressions/constants.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"constants.test.js","sourceRoot":"","sources":["../../src/expressions/constants.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACN,QAAQ,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AAExB,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,SAAS,CAAC,eAAe,E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,GAAG,EAAE,EAAE;YAEP,UAAU;YACV,GAAG,EAAE,EAAE;YACP,GAAG,EAAE,EAAE;YACP,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as ast from
|
|
2
|
-
import { AstFactory } from
|
|
1
|
+
import * as ast from "./ast.js";
|
|
2
|
+
import { AstFactory } from "./ast_factory.js";
|
|
3
3
|
export interface Scope {
|
|
4
4
|
[key: string]: unknown;
|
|
5
5
|
}
|
|
@@ -9,76 +9,76 @@ export interface Evaluatable {
|
|
|
9
9
|
}
|
|
10
10
|
export type Expression = Literal | Empty | ID | Unary | Binary | Getter | Invoke | Index | Ternary | Map | List | ArrowFunction | SpreadProperty | SpreadElement | Property;
|
|
11
11
|
export interface Literal extends Evaluatable {
|
|
12
|
-
type:
|
|
12
|
+
type: "Literal";
|
|
13
13
|
value: ast.LiteralValue;
|
|
14
14
|
}
|
|
15
15
|
export interface Empty extends Evaluatable {
|
|
16
|
-
type:
|
|
16
|
+
type: "Empty";
|
|
17
17
|
}
|
|
18
18
|
export interface ID extends Evaluatable {
|
|
19
|
-
type:
|
|
19
|
+
type: "ID";
|
|
20
20
|
value: string;
|
|
21
21
|
}
|
|
22
22
|
export interface Unary extends Evaluatable {
|
|
23
|
-
type:
|
|
23
|
+
type: "Unary";
|
|
24
24
|
operator: string;
|
|
25
25
|
child: Expression;
|
|
26
26
|
}
|
|
27
27
|
export interface Binary extends Evaluatable {
|
|
28
|
-
type:
|
|
28
|
+
type: "Binary";
|
|
29
29
|
operator: string;
|
|
30
30
|
left: Expression;
|
|
31
31
|
right: Expression;
|
|
32
32
|
}
|
|
33
33
|
export interface Getter extends Evaluatable {
|
|
34
|
-
type:
|
|
34
|
+
type: "Getter";
|
|
35
35
|
receiver: Expression;
|
|
36
36
|
name: string;
|
|
37
37
|
optional?: boolean;
|
|
38
38
|
}
|
|
39
39
|
export interface Invoke extends Evaluatable {
|
|
40
|
-
type:
|
|
40
|
+
type: "Invoke";
|
|
41
41
|
receiver: Expression;
|
|
42
42
|
method: string | undefined;
|
|
43
43
|
arguments: Array<Expression> | undefined;
|
|
44
44
|
optional?: boolean;
|
|
45
45
|
}
|
|
46
46
|
export interface Index extends Evaluatable {
|
|
47
|
-
type:
|
|
47
|
+
type: "Index";
|
|
48
48
|
receiver: Expression;
|
|
49
49
|
argument: Expression;
|
|
50
50
|
optional?: boolean;
|
|
51
51
|
}
|
|
52
52
|
export interface Ternary extends Evaluatable {
|
|
53
|
-
type:
|
|
53
|
+
type: "Ternary";
|
|
54
54
|
condition: Expression;
|
|
55
55
|
trueExpr: Expression;
|
|
56
56
|
falseExpr: Expression;
|
|
57
57
|
}
|
|
58
58
|
export interface Map extends Evaluatable {
|
|
59
|
-
type:
|
|
59
|
+
type: "Map";
|
|
60
60
|
properties?: Array<Property | SpreadProperty> | undefined;
|
|
61
61
|
}
|
|
62
62
|
export interface Property extends Evaluatable {
|
|
63
|
-
type:
|
|
63
|
+
type: "Property";
|
|
64
64
|
key: string;
|
|
65
65
|
value: Expression;
|
|
66
66
|
}
|
|
67
67
|
export interface List extends Evaluatable {
|
|
68
|
-
type:
|
|
68
|
+
type: "List";
|
|
69
69
|
items: Array<Expression> | undefined;
|
|
70
70
|
}
|
|
71
71
|
export interface ArrowFunction extends Evaluatable {
|
|
72
|
-
type:
|
|
72
|
+
type: "ArrowFunction";
|
|
73
73
|
params: Array<string>;
|
|
74
74
|
body: Expression;
|
|
75
75
|
}
|
|
76
76
|
export interface SpreadProperty extends Evaluatable {
|
|
77
|
-
type:
|
|
77
|
+
type: "SpreadProperty";
|
|
78
78
|
expression: Expression;
|
|
79
79
|
}
|
|
80
80
|
export interface SpreadElement extends Evaluatable {
|
|
81
|
-
type:
|
|
81
|
+
type: "SpreadElement";
|
|
82
82
|
expression: Expression;
|
|
83
83
|
}
|
|
84
84
|
export declare class EvalAstFactory implements AstFactory<Expression> {
|