@angular-wave/angular.ts 0.4.0 → 0.4.2
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/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/animations/animate-queue.js +5 -4
- package/src/animations/shared.js +3 -3
- package/src/core/compile/compile.js +1 -1
- package/src/core/interpolate/interpolate.js +35 -28
- package/src/core/{parser/lexer.html → parse/ast/ast.html} +1 -1
- package/src/core/{parser → parse/ast}/ast.js +43 -29
- package/src/core/parse/ast/ast.spec.js +1462 -0
- package/src/core/parse/ast/ast.test.js +10 -0
- package/src/core/{parser → parse}/interpreter.js +10 -10
- package/src/core/parse/lexer/lexer.html +18 -0
- package/src/core/{parser → parse/lexer}/lexer.js +1 -1
- package/src/core/{parser → parse/lexer}/lexer.spec.js +2 -2
- package/src/core/parse/lexer/lexer.test.js +10 -0
- package/src/core/{parser → parse}/parse.html +1 -1
- package/src/core/{parser → parse}/parse.js +5 -5
- package/src/core/{parser → parse}/parse.spec.js +6 -1725
- package/src/core/parse/parse.test.js +10 -0
- package/src/core/parse/parser/parser.html +18 -0
- package/src/core/{parser → parse/parser}/parser.js +6 -6
- package/src/core/parse/parser/parser.spec.js +8 -0
- package/src/core/parse/parser/parser.test.js +10 -0
- package/src/core/scope/scope.js +5 -6
- package/src/directive/class/class.js +1 -1
- package/src/directive/model/model.js +2 -2
- package/src/directive/validators/validators.js +3 -3
- package/src/public.js +1 -1
- package/types/animations/shared.d.ts +1 -1
- package/types/core/compile/compile.d.ts +1 -1
- package/types/core/interpolate/interpolate.d.ts +7 -4
- package/types/core/{parser → parse/ast}/ast.d.ts +17 -17
- package/types/core/{parser → parse}/interpreter.d.ts +7 -7
- package/types/core/{parser → parse/parser}/parser.d.ts +8 -8
- package/types/core/scope/scope.d.ts +3 -3
- package/types/directive/class/class.d.ts +3 -3
- package/types/directive/model/model.d.ts +6 -6
- package/types/directive/validators/validators.d.ts +3 -3
- package/src/core/parser/parser.test.js +0 -19
- /package/src/core/{parser → parse}/ast-type.js +0 -0
- /package/src/core/{parser → parse}/parse.md +0 -0
- /package/types/core/{parser → parse}/ast-type.d.ts +0 -0
- /package/types/core/{parser → parse/lexer}/lexer.d.ts +0 -0
- /package/types/core/{parser → parse}/parse.d.ts +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
test("parser unit tests contain no errors", async ({ page }) => {
|
|
4
|
+
await page.goto("src/core/parse/parse.html");
|
|
5
|
+
await page.content();
|
|
6
|
+
await page.waitForTimeout(100);
|
|
7
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
+
/0 failures/,
|
|
9
|
+
);
|
|
10
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>AngularTS Test Runner</title>
|
|
6
|
+
|
|
7
|
+
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
8
|
+
<link rel="stylesheet" href="/jasmine/jasmine-5.1.2/jasmine.css" />
|
|
9
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine.js"></script>
|
|
10
|
+
<script src="/jasmine/jasmine-5.1.2/jasmine-html.js"></script>
|
|
11
|
+
<script src="/jasmine/jasmine-5.1.2/boot0.js"></script>
|
|
12
|
+
<script src="/jasmine/jasmine-5.1.2/boot1.js"></script>
|
|
13
|
+
<script type="module" src="/src/core/parse/parser/parser.spec.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="dummy"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AST } from "
|
|
2
|
-
import { ASTType } from "
|
|
3
|
-
import { ASTInterpreter } from "
|
|
1
|
+
import { AST } from "../ast/ast.js";
|
|
2
|
+
import { ASTType } from "../ast-type.js";
|
|
3
|
+
import { ASTInterpreter } from "../interpreter.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {Object} ParsedAST
|
|
7
|
-
* @property {import("
|
|
7
|
+
* @property {import("../ast/ast.js").ASTNode} ast - AST representation of expression
|
|
8
8
|
* @property {boolean} oneTime - True if expression should be evaluated only once
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ import { ASTInterpreter } from "./interpreter";
|
|
|
14
14
|
export class Parser {
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
|
-
* @param {import('
|
|
17
|
+
* @param {import('../lexer/lexer.js').Lexer} lexer
|
|
18
18
|
* @param {function(any):any} $filter
|
|
19
19
|
*/
|
|
20
20
|
constructor(lexer, $filter) {
|
|
@@ -28,7 +28,7 @@ export class Parser {
|
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @param {string} exp - Expression to be parsed
|
|
31
|
-
* @returns {import("
|
|
31
|
+
* @returns {import("../parse.js").CompiledExpression}
|
|
32
32
|
*/
|
|
33
33
|
parse(exp) {
|
|
34
34
|
const { ast, oneTime } = this.getAst(exp);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
test("parser unit tests contain no errors", async ({ page }) => {
|
|
4
|
+
await page.goto("src/core/parse/parser/parser.html");
|
|
5
|
+
await page.content();
|
|
6
|
+
await page.waitForTimeout(100);
|
|
7
|
+
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
+
/0 failures/,
|
|
9
|
+
);
|
|
10
|
+
});
|
package/src/core/scope/scope.js
CHANGED
|
@@ -69,7 +69,7 @@ let lastDirtyWatch = null;
|
|
|
69
69
|
let applyAsyncId = null;
|
|
70
70
|
|
|
71
71
|
/** Services required by each scope instance */
|
|
72
|
-
/** @type {import('../
|
|
72
|
+
/** @type {import('../parse/parse').ParseService} */
|
|
73
73
|
let $parse;
|
|
74
74
|
/** @type {import('../../services/browser').Browser} */
|
|
75
75
|
let $browser;
|
|
@@ -98,11 +98,11 @@ export class RootScopeProvider {
|
|
|
98
98
|
"$browser",
|
|
99
99
|
/**
|
|
100
100
|
* @param {import('../exception-handler').ErrorHandler} exceptionHandler
|
|
101
|
-
* @param {import('../
|
|
101
|
+
* @param {import('../parse/parse').ParseService} parse
|
|
102
102
|
* @param {import('../../services/browser').Browser} browser
|
|
103
103
|
* @returns {Scope} root scope
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
(exceptionHandler, parse, browser) => {
|
|
106
106
|
$exceptionHandler = exceptionHandler;
|
|
107
107
|
$parse = parse;
|
|
108
108
|
$browser = browser;
|
|
@@ -200,7 +200,6 @@ export class Scope {
|
|
|
200
200
|
/** @type {boolean} */
|
|
201
201
|
this.$$suspended = false;
|
|
202
202
|
|
|
203
|
-
// TODO use maps
|
|
204
203
|
/** @type {Map<String, Function[]>} */
|
|
205
204
|
this.$$listeners = new Map();
|
|
206
205
|
|
|
@@ -245,7 +244,7 @@ export class Scope {
|
|
|
245
244
|
let child = isolate ? new Scope() : Object.create(this);
|
|
246
245
|
|
|
247
246
|
if (isolate) {
|
|
248
|
-
child.$root = this
|
|
247
|
+
child.$root = this.$root;
|
|
249
248
|
} else {
|
|
250
249
|
// Initialize properties for a non-isolated child scope
|
|
251
250
|
child.$id = nextUid();
|
|
@@ -376,7 +375,7 @@ export class Scope {
|
|
|
376
375
|
*
|
|
377
376
|
*
|
|
378
377
|
*
|
|
379
|
-
* @param {string | ((scope: Scope) => any) | import("../
|
|
378
|
+
* @param {string | ((scope: Scope) => any) | import("../parse/parse.js").CompiledExpression} watchExp Expression that is evaluated on each
|
|
380
379
|
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
|
|
381
380
|
* a call to the `listener`.
|
|
382
381
|
*
|
|
@@ -8,7 +8,7 @@ function classDirective(name, selector) {
|
|
|
8
8
|
"$parse",
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* @param {import("../../core/
|
|
11
|
+
* @param {import("../../core/parse/parse.js").ParseService} $parse
|
|
12
12
|
* @returns {import("../../types").Directive}
|
|
13
13
|
*/
|
|
14
14
|
($parse) => ({
|
|
@@ -87,7 +87,7 @@ export class NgModelController {
|
|
|
87
87
|
* @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
|
|
88
88
|
* @param {import('../../core/compile/attributes').Attributes} $attr
|
|
89
89
|
* @param {import('../../shared/jqlite/jqlite').JQLite} $element
|
|
90
|
-
* @param {import("../../core/
|
|
90
|
+
* @param {import("../../core/parse/parse").ParseService} $parse
|
|
91
91
|
* @param {*} $animate
|
|
92
92
|
* @param {*} $timeout
|
|
93
93
|
* @param {import("../../core/q/q").QPromise<any>} $q
|
|
@@ -147,7 +147,7 @@ export class NgModelController {
|
|
|
147
147
|
this.$$parsedNgModel = $parse($attr["ngModel"]);
|
|
148
148
|
this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;
|
|
149
149
|
|
|
150
|
-
/** @type {import("../../core/
|
|
150
|
+
/** @type {import("../../core/parse/parse").CompiledExpression|((Scope) => any)} */
|
|
151
151
|
this.$$ngModelGet = this.$$parsedNgModel;
|
|
152
152
|
this.$$ngModelSet = this.$$parsedNgModelAssign;
|
|
153
153
|
this.$$pendingDebounce = null;
|
|
@@ -34,7 +34,7 @@ import { startingTag } from "../../shared/jqlite/jqlite";
|
|
|
34
34
|
export const requiredDirective = [
|
|
35
35
|
"$parse",
|
|
36
36
|
/**
|
|
37
|
-
* @param {import("../../core/
|
|
37
|
+
* @param {import("../../core/parse/parse.js").ParseService} $parse
|
|
38
38
|
* @returns {import("../../types.js").Directive}
|
|
39
39
|
*/
|
|
40
40
|
($parse) => ({
|
|
@@ -117,7 +117,7 @@ export const requiredDirective = [
|
|
|
117
117
|
export const patternDirective = [
|
|
118
118
|
"$parse",
|
|
119
119
|
/**
|
|
120
|
-
* @param {import("../../core/
|
|
120
|
+
* @param {import("../../core/parse/parse.js").ParseService} $parse
|
|
121
121
|
* @returns {import("../../types.js").Directive}
|
|
122
122
|
*/
|
|
123
123
|
($parse) => {
|
|
@@ -218,7 +218,7 @@ export const patternDirective = [
|
|
|
218
218
|
export const maxlengthDirective = [
|
|
219
219
|
"$parse",
|
|
220
220
|
/**
|
|
221
|
-
* @param {import("../../core/
|
|
221
|
+
* @param {import("../../core/parse/parse.js").ParseService} $parse
|
|
222
222
|
* @returns {import("../../types.js").Directive}
|
|
223
223
|
*/
|
|
224
224
|
($parse) => ({
|
package/src/public.js
CHANGED
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
import { HttpBackendProvider } from "./services/http-backend/http-backend";
|
|
74
74
|
import { LocationProvider } from "./core/location/location";
|
|
75
75
|
import { LogProvider } from "./services/log";
|
|
76
|
-
import { ParseProvider } from "./core/
|
|
76
|
+
import { ParseProvider } from "./core/parse/parse.js";
|
|
77
77
|
import { RootScopeProvider } from "./core/scope/scope";
|
|
78
78
|
import { $QProvider } from "./core/q/q";
|
|
79
79
|
import { SceProvider, SceDelegateProvider } from "./core/sce/sce";
|
|
@@ -62,4 +62,4 @@ export const ANIMATION_DURATION_PROP: string;
|
|
|
62
62
|
export const TRANSITION_DELAY_PROP: string;
|
|
63
63
|
export const TRANSITION_DURATION_PROP: string;
|
|
64
64
|
export const ngMinErr: (arg0: string, ...arg1: any[]) => Error;
|
|
65
|
-
import { JQLite } from "../shared/jqlite/jqlite";
|
|
65
|
+
import { JQLite } from "../shared/jqlite/jqlite.js";
|
|
@@ -99,7 +99,7 @@ export class CompileProvider {
|
|
|
99
99
|
* @returns {object} `this` for chaining
|
|
100
100
|
*/
|
|
101
101
|
addPropertySecurityContext: (elementName: string, propertyName: string, ctx: string) => object;
|
|
102
|
-
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../
|
|
102
|
+
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../parse/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
103
103
|
}
|
|
104
104
|
export namespace CompileProvider {
|
|
105
105
|
let $inject: string[];
|
|
@@ -10,23 +10,26 @@
|
|
|
10
10
|
* security bugs!
|
|
11
11
|
* </div>
|
|
12
12
|
*/
|
|
13
|
-
export function InterpolateProvider(): void;
|
|
14
13
|
export class InterpolateProvider {
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
start: string;
|
|
16
|
+
/** @type {string} */
|
|
17
|
+
end: string;
|
|
15
18
|
/**
|
|
16
19
|
* Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
|
|
17
20
|
*
|
|
18
21
|
* @param {string=} value new value to set the starting symbol to.
|
|
19
22
|
* @returns {string|InterpolateProvider} Returns the symbol when used as getter and self if used as setter.
|
|
20
23
|
*/
|
|
21
|
-
startSymbol
|
|
24
|
+
startSymbol(value?: string | undefined): string | InterpolateProvider;
|
|
22
25
|
/**
|
|
23
26
|
* Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
|
|
24
27
|
*
|
|
25
28
|
* @param {string=} value new value to set the ending symbol to.
|
|
26
29
|
* @returns {string|InterpolateProvider} Returns the symbol when used as getter and self if used as setter.
|
|
27
30
|
*/
|
|
28
|
-
endSymbol
|
|
29
|
-
$get: (string | (($parse: import("../
|
|
31
|
+
endSymbol(value?: string | undefined): string | InterpolateProvider;
|
|
32
|
+
$get: (string | (($parse: import("../parse/parse").ParseService, $sce: any) => {
|
|
30
33
|
(text: string, mustHaveExpression?: boolean | undefined, trustedContext?: string | undefined, allOrNothing?: boolean | undefined): Function;
|
|
31
34
|
/**
|
|
32
35
|
* Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
|
|
@@ -32,11 +32,11 @@ export const literals: Map<string, any>;
|
|
|
32
32
|
*/
|
|
33
33
|
export class AST {
|
|
34
34
|
/**
|
|
35
|
-
* @param {import('
|
|
35
|
+
* @param {import('../lexer/lexer.js').Lexer} lexer - The lexer instance for tokenizing input
|
|
36
36
|
*/
|
|
37
|
-
constructor(lexer: import("
|
|
38
|
-
/** @type {import('
|
|
39
|
-
lexer: import("
|
|
37
|
+
constructor(lexer: import("../lexer/lexer.js").Lexer);
|
|
38
|
+
/** @type {import('../lexer/lexer.js').Lexer} */
|
|
39
|
+
lexer: import("../lexer/lexer.js").Lexer;
|
|
40
40
|
selfReferential: {
|
|
41
41
|
this: {
|
|
42
42
|
type: 15;
|
|
@@ -52,7 +52,7 @@ export class AST {
|
|
|
52
52
|
*/
|
|
53
53
|
ast(text: string): ASTNode;
|
|
54
54
|
text: string;
|
|
55
|
-
tokens: import("
|
|
55
|
+
tokens: import("../lexer/lexer.js").Token[];
|
|
56
56
|
/**
|
|
57
57
|
* Parses a program.
|
|
58
58
|
* @returns {ASTNode} The program node.
|
|
@@ -152,39 +152,39 @@ export class AST {
|
|
|
152
152
|
/**
|
|
153
153
|
* Throws a syntax error.
|
|
154
154
|
* @param {string} msg - The error message.
|
|
155
|
-
* @param {import("
|
|
155
|
+
* @param {import("../lexer/lexer.js").Token} [token] - The token that caused the error.
|
|
156
156
|
*/
|
|
157
|
-
throwError(msg: string, token?: import("
|
|
157
|
+
throwError(msg: string, token?: import("../lexer/lexer.js").Token): void;
|
|
158
158
|
/**
|
|
159
159
|
* Consumes a token if it matches the expected type.
|
|
160
160
|
* @param {string} [e1] - The expected token type.
|
|
161
|
-
* @returns {import("
|
|
161
|
+
* @returns {import("../lexer/lexer.js").Token} The consumed token.
|
|
162
162
|
*/
|
|
163
|
-
consume(e1?: string): import("
|
|
163
|
+
consume(e1?: string): import("../lexer/lexer.js").Token;
|
|
164
164
|
/**
|
|
165
165
|
* Returns the next token without consuming it.
|
|
166
|
-
* @returns {import("
|
|
166
|
+
* @returns {import("../lexer/lexer.js").Token} The next token.
|
|
167
167
|
*/
|
|
168
|
-
peekToken(): import("
|
|
168
|
+
peekToken(): import("../lexer/lexer.js").Token;
|
|
169
169
|
/**
|
|
170
170
|
* Checks if the next token matches any of the expected types.
|
|
171
171
|
* @param {...string} [expected] - The expected token types.
|
|
172
|
-
* @returns {import('
|
|
172
|
+
* @returns {import('../lexer/lexer.js').Token|boolean} The next token if it matches, otherwise false.
|
|
173
173
|
*/
|
|
174
|
-
peek(...expected?: string[]): import("
|
|
174
|
+
peek(...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
175
175
|
/**
|
|
176
176
|
* Checks if the token at the specified index matches any of the expected types.
|
|
177
177
|
* @param {number} i - The index to check.
|
|
178
178
|
* @param {...string} [expected] - The expected token types.
|
|
179
|
-
* @returns {import("
|
|
179
|
+
* @returns {import("../lexer/lexer.js").Token|boolean} The token at the specified index if it matches, otherwise false.
|
|
180
180
|
*/
|
|
181
|
-
peekAhead(i: number, ...expected?: string[]): import("
|
|
181
|
+
peekAhead(i: number, ...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
182
182
|
/**
|
|
183
183
|
* Consumes the next token if it matches any of the expected types.
|
|
184
184
|
* @param {...string} [expected] - The expected token types.
|
|
185
|
-
* @returns {import("
|
|
185
|
+
* @returns {import("../lexer/lexer.js").Token|boolean} The consumed token if it matches, otherwise false.
|
|
186
186
|
*/
|
|
187
|
-
expect(...expected?: string[]): import("
|
|
187
|
+
expect(...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
188
188
|
}
|
|
189
189
|
export type ASTNode = {
|
|
190
190
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {import("./ast").ASTNode} ast
|
|
2
|
+
* @param {import("./ast/ast").ASTNode} ast
|
|
3
3
|
* @returns {boolean}
|
|
4
4
|
*/
|
|
5
|
-
export function isAssignable(ast: import("./ast").ASTNode): boolean;
|
|
5
|
+
export function isAssignable(ast: import("./ast/ast").ASTNode): boolean;
|
|
6
6
|
export const PURITY_ABSOLUTE: 1;
|
|
7
7
|
export const PURITY_RELATIVE: 2;
|
|
8
8
|
export class ASTInterpreter {
|
|
@@ -13,18 +13,18 @@ export class ASTInterpreter {
|
|
|
13
13
|
$filter: (arg0: any) => any;
|
|
14
14
|
/**
|
|
15
15
|
* Compiles the AST into a function.
|
|
16
|
-
* @param {import("./ast").ASTNode} ast - The AST to compile.
|
|
16
|
+
* @param {import("./ast/ast").ASTNode} ast - The AST to compile.
|
|
17
17
|
* @returns {import("./parse").CompiledExpression}
|
|
18
18
|
*/
|
|
19
|
-
compile(ast: import("./ast").ASTNode): import("./parse").CompiledExpression;
|
|
19
|
+
compile(ast: import("./ast/ast").ASTNode): import("./parse").CompiledExpression;
|
|
20
20
|
/**
|
|
21
21
|
* Recurses the AST nodes.
|
|
22
|
-
* @param {import("./ast").ASTNode} ast - The AST node.
|
|
22
|
+
* @param {import("./ast/ast").ASTNode} ast - The AST node.
|
|
23
23
|
* @param {Object} [context] - The context.
|
|
24
24
|
* @param {boolean|1} [create] - The create flag.
|
|
25
25
|
* @returns {import("./parse").CompiledExpressionFunction} The recursive function.
|
|
26
26
|
*/
|
|
27
|
-
recurse(ast: import("./ast").ASTNode, context?: any, create?: boolean | 1): import("./parse").CompiledExpressionFunction;
|
|
27
|
+
recurse(ast: import("./ast/ast").ASTNode, context?: any, create?: boolean | 1): import("./parse").CompiledExpressionFunction;
|
|
28
28
|
/**
|
|
29
29
|
* Unary plus operation.
|
|
30
30
|
* @param {function} argument - The argument function.
|
|
@@ -204,7 +204,7 @@ export class ASTInterpreter {
|
|
|
204
204
|
*/
|
|
205
205
|
nonComputedMember(left: Function, right: string, context?: any, create?: boolean | 1): Function;
|
|
206
206
|
}
|
|
207
|
-
export type DecoratedASTNode = import("./ast").ASTNode & {
|
|
207
|
+
export type DecoratedASTNode = import("./ast/ast").ASTNode & {
|
|
208
208
|
isPure: boolean | number;
|
|
209
209
|
constant: boolean;
|
|
210
210
|
toWatch: any[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} ParsedAST
|
|
3
|
-
* @property {import("
|
|
3
|
+
* @property {import("../ast/ast.js").ASTNode} ast - AST representation of expression
|
|
4
4
|
* @property {boolean} oneTime - True if expression should be evaluated only once
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
export class Parser {
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
|
-
* @param {import('
|
|
12
|
+
* @param {import('../lexer/lexer.js').Lexer} lexer
|
|
13
13
|
* @param {function(any):any} $filter
|
|
14
14
|
*/
|
|
15
|
-
constructor(lexer: import("
|
|
15
|
+
constructor(lexer: import("../lexer/lexer.js").Lexer, $filter: (arg0: any) => any);
|
|
16
16
|
/** @type {AST} */
|
|
17
17
|
ast: AST;
|
|
18
18
|
/** @type {ASTInterpreter} */
|
|
@@ -20,9 +20,9 @@ export class Parser {
|
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* @param {string} exp - Expression to be parsed
|
|
23
|
-
* @returns {import("
|
|
23
|
+
* @returns {import("../parse.js").CompiledExpression}
|
|
24
24
|
*/
|
|
25
|
-
parse(exp: string): import("
|
|
25
|
+
parse(exp: string): import("../parse.js").CompiledExpression;
|
|
26
26
|
/**
|
|
27
27
|
* @param {string} exp - Expression to be parsed
|
|
28
28
|
* @returns {ParsedAST}
|
|
@@ -33,11 +33,11 @@ export type ParsedAST = {
|
|
|
33
33
|
/**
|
|
34
34
|
* - AST representation of expression
|
|
35
35
|
*/
|
|
36
|
-
ast: import("
|
|
36
|
+
ast: import("../ast/ast.js").ASTNode;
|
|
37
37
|
/**
|
|
38
38
|
* - True if expression should be evaluated only once
|
|
39
39
|
*/
|
|
40
40
|
oneTime: boolean;
|
|
41
41
|
};
|
|
42
|
-
import { AST } from "
|
|
43
|
-
import { ASTInterpreter } from "
|
|
42
|
+
import { AST } from "../ast/ast.js";
|
|
43
|
+
import { ASTInterpreter } from "../interpreter.js";
|
|
@@ -74,7 +74,7 @@ export const $$applyAsyncQueue: Function[];
|
|
|
74
74
|
*/
|
|
75
75
|
export class RootScopeProvider {
|
|
76
76
|
rootScope: Scope;
|
|
77
|
-
$get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../
|
|
77
|
+
$get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../parse/parse").ParseService, browser: import("../../services/browser").Browser) => Scope))[];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* DESIGN NOTES
|
|
@@ -282,7 +282,7 @@ export class Scope {
|
|
|
282
282
|
*
|
|
283
283
|
*
|
|
284
284
|
*
|
|
285
|
-
* @param {string | ((scope: Scope) => any) | import("../
|
|
285
|
+
* @param {string | ((scope: Scope) => any) | import("../parse/parse.js").CompiledExpression} watchExp Expression that is evaluated on each
|
|
286
286
|
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
|
|
287
287
|
* a call to the `listener`.
|
|
288
288
|
*
|
|
@@ -293,7 +293,7 @@ export class Scope {
|
|
|
293
293
|
* comparing for reference equality.
|
|
294
294
|
* @returns {function()} Returns a deregistration function for this listener.
|
|
295
295
|
*/
|
|
296
|
-
$watch(watchExp: string | ((scope: Scope) => any) | import("../
|
|
296
|
+
$watch(watchExp: string | ((scope: Scope) => any) | import("../parse/parse.js").CompiledExpression, listener?: WatchListener, objectEquality?: boolean | undefined): () => any;
|
|
297
297
|
/**
|
|
298
298
|
* A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.
|
|
299
299
|
* If any one expression in the collection changes the `listener` is executed.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const ngClassDirective: (string | (($parse: import("../../core/
|
|
2
|
-
export const ngClassOddDirective: (string | (($parse: import("../../core/
|
|
3
|
-
export const ngClassEvenDirective: (string | (($parse: import("../../core/
|
|
1
|
+
export const ngClassDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
2
|
+
export const ngClassOddDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
3
|
+
export const ngClassEvenDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
@@ -55,13 +55,13 @@ export class NgModelController {
|
|
|
55
55
|
* @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
|
|
56
56
|
* @param {import('../../core/compile/attributes').Attributes} $attr
|
|
57
57
|
* @param {import('../../shared/jqlite/jqlite').JQLite} $element
|
|
58
|
-
* @param {import("../../core/
|
|
58
|
+
* @param {import("../../core/parse/parse").ParseService} $parse
|
|
59
59
|
* @param {*} $animate
|
|
60
60
|
* @param {*} $timeout
|
|
61
61
|
* @param {import("../../core/q/q").QPromise<any>} $q
|
|
62
62
|
* @param {*} $interpolate
|
|
63
63
|
*/
|
|
64
|
-
constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/
|
|
64
|
+
constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/parse/parse").ParseService, $animate: any, $timeout: any, $q: import("../../core/q/q").QPromise<any>, $interpolate: any);
|
|
65
65
|
/** @type {any} The actual value from the control's view */
|
|
66
66
|
$viewValue: any;
|
|
67
67
|
/** @type {any} The value in the model that the control is bound to. */
|
|
@@ -108,10 +108,10 @@ export class NgModelController {
|
|
|
108
108
|
};
|
|
109
109
|
$$updateEvents: string;
|
|
110
110
|
$$updateEventHandler(ev: any): void;
|
|
111
|
-
$$parsedNgModel: import("../../core/
|
|
111
|
+
$$parsedNgModel: import("../../core/parse/parse").CompiledExpression;
|
|
112
112
|
$$parsedNgModelAssign: (arg0: any, arg1: any) => any;
|
|
113
|
-
/** @type {import("../../core/
|
|
114
|
-
$$ngModelGet: import("../../core/
|
|
113
|
+
/** @type {import("../../core/parse/parse").CompiledExpression|((Scope) => any)} */
|
|
114
|
+
$$ngModelGet: import("../../core/parse/parse").CompiledExpression | ((Scope: any) => any);
|
|
115
115
|
$$ngModelSet: (arg0: any, arg1: any) => any;
|
|
116
116
|
$$pendingDebounce: any;
|
|
117
117
|
$$parserValid: boolean;
|
|
@@ -127,7 +127,7 @@ export class NgModelController {
|
|
|
127
127
|
$$element: import("../../shared/jqlite/jqlite").JQLite;
|
|
128
128
|
$$animate: any;
|
|
129
129
|
$$timeout: any;
|
|
130
|
-
$$parse: import("../../core/
|
|
130
|
+
$$parse: import("../../core/parse/parse").ParseService;
|
|
131
131
|
$q: import("../../core/q/q").QPromise<any>;
|
|
132
132
|
$$exceptionHandler: import("../../core/exception-handler").ErrorHandler;
|
|
133
133
|
$$hasNativeValidators: boolean;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export const requiredDirective: (string | (($parse: import("../../core/
|
|
24
|
+
export const requiredDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
25
25
|
/**
|
|
26
26
|
* @param {String|RegExp} ngPattern AngularJS expression that must evaluate to a `RegExp` or a `String`
|
|
27
27
|
* parsable into a `RegExp`, or a `RegExp` literal. See above for
|
|
@@ -61,7 +61,7 @@ export const requiredDirective: (string | (($parse: import("../../core/parser/pa
|
|
|
61
61
|
* </ol>
|
|
62
62
|
* </div>
|
|
63
63
|
*/
|
|
64
|
-
export const patternDirective: (string | (($parse: import("../../core/
|
|
64
|
+
export const patternDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
65
65
|
/**
|
|
66
66
|
* @param {string} ngMaxlength AngularJS expression that must evaluate to a `Number` or `String`
|
|
67
67
|
* parsable into a `Number`. Used as value for the `maxlength`
|
|
@@ -92,7 +92,7 @@ export const patternDirective: (string | (($parse: import("../../core/parser/par
|
|
|
92
92
|
* </div>
|
|
93
93
|
*
|
|
94
94
|
*/
|
|
95
|
-
export const maxlengthDirective: (string | (($parse: import("../../core/
|
|
95
|
+
export const maxlengthDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
96
96
|
/**
|
|
97
97
|
*
|
|
98
98
|
* @param {string} ngMinlength AngularJS expression that must evaluate to a `Number` or `String`
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
test("lexer unit tests contain no errors", async ({ page }) => {
|
|
4
|
-
await page.goto("src/core/parser/lexer.html");
|
|
5
|
-
await page.content();
|
|
6
|
-
await page.waitForTimeout(100);
|
|
7
|
-
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
-
/0 failures/,
|
|
9
|
-
);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test("parser unit tests contain no errors", async ({ page }) => {
|
|
13
|
-
await page.goto("src/core/parser/parse.html");
|
|
14
|
-
await page.content();
|
|
15
|
-
await page.waitForTimeout(100);
|
|
16
|
-
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
17
|
-
/0 failures/,
|
|
18
|
-
);
|
|
19
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|