@angular-wave/angular.ts 0.8.3 → 0.9.0
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/@types/services/sce/sce.d.ts +0 -8
- package/dist/angular-ts.esm.js +33 -23
- package/dist/angular-ts.umd.js +33 -23
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/layouts/shortcodes/version.html +1 -1
- package/package.json +1 -1
- package/src/animations/animations.test.js +1 -1
- package/src/binding.test.js +1 -1
- package/src/core/compile/compile.spec.js +2 -2
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/controller/controller.test.js +1 -1
- package/src/core/core.test.js +1 -1
- package/src/core/di/injector.test.js +1 -1
- package/src/core/di/ng-module.test.js +1 -1
- package/src/core/filter/filter.test.js +1 -1
- package/src/core/interpolate/interpolate.test.js +1 -1
- package/src/core/parse/ast/ast.test.js +1 -1
- package/src/core/parse/interpreter.js +27 -7
- package/src/core/parse/lexer/lexer.test.js +1 -1
- package/src/core/parse/parse.spec.js +6 -8
- package/src/core/parse/parse.test.js +1 -1
- package/src/core/parse/parser/parser.test.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +1 -1
- package/src/core/scope/scope.js +3 -9
- package/src/core/scope/scope.spec.js +6 -6
- package/src/core/scope/scope.test.js +12 -0
- package/src/directive/aria/aria.test.js +1 -1
- package/src/directive/attrs/attrs.test.js +1 -1
- package/src/directive/attrs/boolean.test.js +1 -1
- package/src/directive/attrs/element-style.test.js +1 -1
- package/src/directive/attrs/src.test.js +1 -1
- package/src/directive/bind/bind.test.js +1 -1
- package/src/directive/channel/channel.test.js +1 -1
- package/src/directive/class/class-test.html +23 -0
- package/src/directive/class/class.test.js +1 -1
- package/src/directive/cloak/cloak.test.js +1 -1
- package/src/directive/controller/controller.test.js +1 -1
- package/src/directive/events/events.test.js +1 -1
- package/src/directive/form/form.test.js +1 -1
- package/src/directive/http/http.test.js +1 -1
- package/src/directive/if/if.test.js +1 -1
- package/src/directive/include/include.test.js +1 -1
- package/src/directive/init/init.test.js +1 -1
- package/src/directive/input/input.test.js +1 -1
- package/src/directive/messages/messages.spec.js +6 -5
- package/src/directive/messages/messages.test.js +2 -2
- package/src/directive/model/model.test.js +1 -1
- package/src/directive/model-options/model-option.test.js +1 -1
- package/src/directive/non-bindable/non-bindable.test.js +1 -1
- package/src/directive/observe/observe.test.js +1 -1
- package/src/directive/on/on.test.js +1 -1
- package/src/directive/options/options.test.js +1 -1
- package/src/directive/ref/href.test.js +2 -2
- package/src/directive/repeat/repeat.spec.js +61 -61
- package/src/directive/repeat/repeat.test.js +2 -2
- package/src/directive/script/script.test.js +1 -1
- package/src/directive/select/select.test.js +1 -1
- package/src/directive/setter/setter.test.js +1 -1
- package/src/directive/show-hide/show-hide.test.js +1 -1
- package/src/directive/style/style.test.js +1 -1
- package/src/directive/switch/switch.test.js +1 -1
- package/src/directive/validators/validators.test.js +1 -1
- package/src/filters/filters.test.js +1 -1
- package/src/router/directives/state-directives.test.js +1 -1
- package/src/router/directives/view-directive.spec.js +9 -5
- package/src/router/directives/view-directive.test.js +1 -1
- package/src/router/glob/glob.test.js +1 -1
- package/src/router/router.test.js +1 -1
- package/src/router/state/state.test.js +1 -1
- package/src/router/template-factory.spec.js +1 -4
- package/src/router/template-factory.test.js +1 -1
- package/src/router/url/url.test.js +1 -1
- package/src/router/view/view.test.js +1 -1
- package/src/services/http/http.test.js +1 -1
- package/src/services/http-backend/http-backend.test.js +1 -1
- package/src/services/location/location.test.js +1 -1
- package/src/services/log/log.test.js +1 -1
- package/src/services/pubsub/pubsub.test.js +1 -1
- package/src/services/sce/sce.js +7 -6
- package/src/services/sce/sce.test.js +1 -1
- package/src/services/template-cache/template-cache.test.js +1 -1
- package/src/shared/shared.test.js +1 -1
- package/src/shared/url-utils/url-utils.test.js +1 -1
- package/src/src.test.js +1 -1
- package/src/loader.md +0 -0
|
@@ -5,7 +5,7 @@ test("unit href tests contain no errors", async ({ page }) => {
|
|
|
5
5
|
await page.content();
|
|
6
6
|
await page.waitForTimeout(1000);
|
|
7
7
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
-
/0 failures/,
|
|
8
|
+
/ 0 failures/,
|
|
9
9
|
);
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -14,6 +14,6 @@ test("unit ref tests contain no errors", async ({ page }) => {
|
|
|
14
14
|
await page.content();
|
|
15
15
|
await page.waitForTimeout(1000);
|
|
16
16
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
17
|
-
/0 failures/,
|
|
17
|
+
/ 0 failures/,
|
|
18
18
|
);
|
|
19
19
|
});
|
|
@@ -14,6 +14,8 @@ describe("ngRepeat", () => {
|
|
|
14
14
|
let logs = [];
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
|
+
const el = document.getElementById("app");
|
|
18
|
+
dealoc(el);
|
|
17
19
|
delete window.angular;
|
|
18
20
|
logs = [];
|
|
19
21
|
window.angular = new Angular();
|
|
@@ -26,7 +28,7 @@ describe("ngRepeat", () => {
|
|
|
26
28
|
};
|
|
27
29
|
});
|
|
28
30
|
|
|
29
|
-
injector = window.angular.bootstrap(
|
|
31
|
+
injector = window.angular.bootstrap(el, [
|
|
30
32
|
"defaultModule",
|
|
31
33
|
(_$compileProvider_) => {
|
|
32
34
|
$compileProvider = _$compileProvider_;
|
|
@@ -223,80 +225,78 @@ describe("ngRepeat", () => {
|
|
|
223
225
|
expect(element.textContent.trim()).toEqual("");
|
|
224
226
|
});
|
|
225
227
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
scope,
|
|
241
|
-
);
|
|
242
|
-
await wait();
|
|
243
|
-
expect(scope[name][0].name).toEqual("blue");
|
|
244
|
-
expect(scope[name][1].name).toEqual("black");
|
|
245
|
-
expect(scope[name][2].name).toEqual("blonde");
|
|
246
|
-
dealoc(element);
|
|
247
|
-
},
|
|
248
|
-
);
|
|
228
|
+
for (const name of ["null2", "qthis", "qthisq", "fundefined", "$$parent"]) {
|
|
229
|
+
it(`should support alias identifier containing reserved word: ${name}`, async () => {
|
|
230
|
+
scope.x = "bl";
|
|
231
|
+
scope.items = [
|
|
232
|
+
{ name: "red" },
|
|
233
|
+
{ name: "blue" },
|
|
234
|
+
{ name: "green" },
|
|
235
|
+
{ name: "black" },
|
|
236
|
+
{ name: "orange" },
|
|
237
|
+
{ name: "blonde" },
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
const expr = `item in items | filter:x as ${name}`;
|
|
241
|
+
element = $compile(`<div><div ng-repeat="${expr}"></div></div>`)(scope);
|
|
249
242
|
|
|
250
|
-
|
|
251
|
-
});
|
|
243
|
+
await wait();
|
|
252
244
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
expect(scope[name][0].name).toEqual("blue");
|
|
246
|
+
expect(scope[name][1].name).toEqual("black");
|
|
247
|
+
expect(scope[name][2].name).toEqual("blonde");
|
|
248
|
+
|
|
249
|
+
dealoc(element);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
for (const expr of [
|
|
254
|
+
"null",
|
|
255
|
+
"this",
|
|
256
|
+
"undefined",
|
|
257
|
+
"$parent",
|
|
258
|
+
"$root",
|
|
259
|
+
"$id",
|
|
260
|
+
"$index",
|
|
261
|
+
"$first",
|
|
262
|
+
"$middle",
|
|
263
|
+
"$last",
|
|
264
|
+
"$even",
|
|
265
|
+
"$odd",
|
|
266
|
+
"obj[key]",
|
|
267
|
+
'obj["key"]',
|
|
268
|
+
"obj['key']",
|
|
269
|
+
"obj.property",
|
|
270
|
+
"foo=6",
|
|
271
|
+
]) {
|
|
272
|
+
it(`should throw if alias identifier is not simple: ${expr}`, async () => {
|
|
273
|
+
scope.x = "bl";
|
|
274
|
+
scope.items = [
|
|
275
|
+
{ name: "red" },
|
|
276
|
+
{ name: "blue" },
|
|
277
|
+
{ name: "green" },
|
|
278
|
+
{ name: "black" },
|
|
279
|
+
{ name: "orange" },
|
|
280
|
+
{ name: "blonde" },
|
|
281
|
+
];
|
|
263
282
|
|
|
264
|
-
[
|
|
265
|
-
"null",
|
|
266
|
-
"this",
|
|
267
|
-
"undefined",
|
|
268
|
-
"$parent",
|
|
269
|
-
"$root",
|
|
270
|
-
"$id",
|
|
271
|
-
"$index",
|
|
272
|
-
"$first",
|
|
273
|
-
"$middle",
|
|
274
|
-
"$last",
|
|
275
|
-
"$even",
|
|
276
|
-
"$odd",
|
|
277
|
-
"obj[key]",
|
|
278
|
-
'obj["key"]',
|
|
279
|
-
"obj['key']",
|
|
280
|
-
"obj.property",
|
|
281
|
-
"foo=6",
|
|
282
|
-
].forEach(async (expr) => {
|
|
283
283
|
const expression = `item in items | filter:x as ${expr}`.replace(
|
|
284
284
|
/"/g,
|
|
285
285
|
""",
|
|
286
286
|
);
|
|
287
287
|
element = $compile(
|
|
288
|
-
`<div
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
`<div>
|
|
289
|
+
<div ng-repeat="${expression}">{{item}}</div>
|
|
290
|
+
</div>`,
|
|
291
291
|
)(scope);
|
|
292
|
+
|
|
292
293
|
await wait();
|
|
294
|
+
|
|
293
295
|
expect(logs.shift().message).toMatch(/must be a valid JS identifier/);
|
|
294
296
|
|
|
295
297
|
dealoc(element);
|
|
296
298
|
});
|
|
297
|
-
|
|
298
|
-
expect().toBe();
|
|
299
|
-
});
|
|
299
|
+
}
|
|
300
300
|
|
|
301
301
|
it("should allow expressions over multiple lines", async () => {
|
|
302
302
|
element = $compile(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { test, expect } from "@playwright/test";
|
|
2
2
|
|
|
3
|
-
const TEST_URL = "src/directive/repeat/repeat.html";
|
|
3
|
+
const TEST_URL = "src/directive/repeat/repeat.html?random=false";
|
|
4
4
|
|
|
5
5
|
test("unit tests contain no errors", async ({ page }) => {
|
|
6
6
|
await page.goto(TEST_URL);
|
|
7
7
|
await page.content();
|
|
8
8
|
await page.waitForTimeout(1000);
|
|
9
9
|
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
-
/0 failures/,
|
|
10
|
+
/ 0 failures/,
|
|
11
11
|
);
|
|
12
12
|
});
|
|
@@ -812,6 +812,7 @@ describe("ngView named", () => {
|
|
|
812
812
|
$viewScroll;
|
|
813
813
|
|
|
814
814
|
beforeEach(() => {
|
|
815
|
+
dealoc(document.getElementById("app"));
|
|
815
816
|
window.angular = new Angular();
|
|
816
817
|
log = "";
|
|
817
818
|
app = window.angular
|
|
@@ -936,8 +937,9 @@ describe("ngView controllers or onEnter handlers", () => {
|
|
|
936
937
|
window.angular = new Angular();
|
|
937
938
|
window.angular
|
|
938
939
|
.module("defaultModule", [])
|
|
939
|
-
.config(function ($stateProvider) {
|
|
940
|
+
.config(function ($locationProvider, $stateProvider) {
|
|
940
941
|
count = 0;
|
|
942
|
+
$locationProvider.html5ModeConf.enabled = false;
|
|
941
943
|
$stateProvider
|
|
942
944
|
.state({
|
|
943
945
|
name: "aside",
|
|
@@ -1015,6 +1017,7 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1015
1017
|
$rootScope;
|
|
1016
1018
|
|
|
1017
1019
|
beforeEach(() => {
|
|
1020
|
+
dealoc(document.getElementById("app"));
|
|
1018
1021
|
window.angular = new Angular();
|
|
1019
1022
|
window.angular
|
|
1020
1023
|
.module("defaultModule", [])
|
|
@@ -1109,8 +1112,9 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1109
1112
|
};
|
|
1110
1113
|
},
|
|
1111
1114
|
})
|
|
1112
|
-
.config(function (_$stateProvider_) {
|
|
1115
|
+
.config(function (_$stateProvider_, $locationProvider) {
|
|
1113
1116
|
$stateProvider = _$stateProvider_;
|
|
1117
|
+
$locationProvider.html5ModeConf.enabled = false;
|
|
1114
1118
|
});
|
|
1115
1119
|
|
|
1116
1120
|
let $injector = window.angular.bootstrap(document.getElementById("app"), [
|
|
@@ -1832,9 +1836,9 @@ describe("angular 1.5+ style .component()", () => {
|
|
|
1832
1836
|
name: "ng12-dynamic-directive",
|
|
1833
1837
|
url: "/ng12dynamicDirective/:type",
|
|
1834
1838
|
componentProvider: [
|
|
1835
|
-
"$
|
|
1836
|
-
function ($
|
|
1837
|
-
return $
|
|
1839
|
+
"$stateParams",
|
|
1840
|
+
function ($stateParams) {
|
|
1841
|
+
return $stateParams.type;
|
|
1838
1842
|
},
|
|
1839
1843
|
],
|
|
1840
1844
|
});
|
|
@@ -48,12 +48,9 @@ describe("templateFactory", () => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it("rejects untrusted URLs", async () => {
|
|
51
|
-
let error = "No error thrown";
|
|
52
51
|
try {
|
|
53
52
|
await $templateFactory.fromUrl("http://evil.com/views/view.html");
|
|
54
|
-
} catch (e) {
|
|
55
|
-
error = e;
|
|
56
|
-
}
|
|
53
|
+
} catch (e) {}
|
|
57
54
|
expect(error).toMatch(/sce:insecurl/);
|
|
58
55
|
});
|
|
59
56
|
|
package/src/services/sce/sce.js
CHANGED
|
@@ -245,8 +245,6 @@ export function adjustMatcher(matcher) {
|
|
|
245
245
|
*/
|
|
246
246
|
export class SceDelegateProvider {
|
|
247
247
|
constructor() {
|
|
248
|
-
this.SCE_CONTEXTS = SCE_CONTEXTS;
|
|
249
|
-
|
|
250
248
|
// Resource URLs can also be trusted by policy.
|
|
251
249
|
let trustedResourceUrlList = ["self"];
|
|
252
250
|
let bannedResourceUrlList = [];
|
|
@@ -545,11 +543,14 @@ export class SceDelegateProvider {
|
|
|
545
543
|
if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
|
|
546
544
|
return maybeTrusted;
|
|
547
545
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
546
|
+
$exceptionHandler(
|
|
547
|
+
$sceMinErr(
|
|
548
|
+
"insecurl",
|
|
549
|
+
"Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",
|
|
550
|
+
maybeTrusted.toString(),
|
|
551
|
+
),
|
|
552
552
|
);
|
|
553
|
+
return;
|
|
553
554
|
} else if (type === SCE_CONTEXTS.HTML) {
|
|
554
555
|
// htmlSanitizer throws its own error when no sanitizer is available.
|
|
555
556
|
return htmlSanitizer();
|
package/src/src.test.js
CHANGED
package/src/loader.md
DELETED
|
File without changes
|