@angular-wave/angular.ts 0.4.4 → 0.4.6
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/Makefile +1 -0
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -12
- package/index.html +3 -74
- package/package.json +1 -1
- package/src/angular.spec.js +5 -0
- package/src/animations/animate-css.js +13 -5
- package/src/animations/animate-queue.js +21 -22
- package/src/animations/animate-runner.js +8 -4
- package/src/animations/animate.md +1 -1
- package/src/animations/animate.spec.js +21 -0
- package/src/animations/animation.js +1 -1
- package/src/binding.spec.js +1 -0
- package/src/core/compile/compile.js +25 -27
- package/src/core/compile/compile.spec.js +266 -17
- package/src/core/controller/controller.js +0 -2
- package/src/core/di/injector.md +1 -1
- package/src/core/di/injector.spec.js +2 -0
- package/src/core/di/internal-injector.js +1 -2
- package/src/core/interpolate/interpolate.js +12 -28
- package/src/core/interpolate/interpolate.spec.js +16 -70
- package/src/core/interval/interval-factory.js +50 -0
- package/src/core/interval/interval.html +18 -0
- package/src/core/interval/interval.js +77 -0
- package/src/core/interval/interval.md +123 -0
- package/src/core/interval/interval.spec.js +280 -0
- package/src/core/interval/interval.test.js +1 -1
- package/src/core/location/location.js +53 -59
- package/src/core/location/location.spec.js +27 -27
- package/src/core/on.spec.js +7 -0
- package/src/core/parse/interpreter.js +7 -10
- package/src/core/parse/parse.js +5 -26
- package/src/core/parse/parse.spec.js +91 -95
- package/src/core/prop.spec.js +60 -4
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +472 -0
- package/src/core/q/q.md +211 -0
- package/src/core/q/q.spec.js +2748 -0
- package/src/core/q/q.test.js +12 -0
- package/src/core/sce/sce.spec.js +8 -0
- package/src/core/{model/model.html → scope/scope.html} +1 -1
- package/src/core/scope/scope.js +16 -15
- package/src/core/scope/scope.spec.js +1959 -24
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +109 -0
- package/src/core/timeout/timeout.spec.js +354 -0
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.spec.js +1 -1
- package/src/directive/aria/aria.js +6 -3
- package/src/directive/aria/aria.spec.js +87 -0
- package/src/directive/attrs/attrs.spec.js +5 -0
- package/src/directive/attrs/boolean.spec.js +15 -0
- package/src/directive/attrs/element-style.spec.js +8 -0
- package/src/directive/attrs/src.spec.js +7 -0
- package/src/directive/bind/bind.spec.js +33 -0
- package/src/directive/bind/bing-html.spec.js +3 -0
- package/src/directive/class/class.js +3 -3
- package/src/directive/class/class.spec.js +75 -9
- package/src/directive/controller/controller.spec.js +13 -0
- package/src/directive/events/click.spec.js +3 -0
- package/src/directive/events/event.spec.js +6 -0
- package/src/directive/events/events.html +1 -0
- package/src/directive/form/form.js +3 -2
- package/src/directive/form/form.spec.js +65 -0
- package/src/directive/if/if.spec.js +4 -0
- package/src/directive/include/include.spec.js +59 -8
- package/src/directive/init/init.js +2 -6
- package/src/directive/init/init.spec.js +2 -0
- package/src/directive/input/input.spec.js +136 -0
- package/src/directive/messages/messages.spec.js +35 -4
- package/src/directive/model/model.js +25 -18
- package/src/directive/model/model.spec.js +49 -2
- package/src/directive/model-options/model-options.spec.js +6 -0
- package/src/directive/non-bindable/non-bindable.spec.js +1 -0
- package/src/directive/observe/observe.js +5 -1
- package/src/directive/observe/observe.spec.js +22 -0
- package/src/directive/observe/test.html +3 -11
- package/src/directive/options/options.spec.js +34 -0
- package/src/directive/ref/href.spec.js +15 -0
- package/src/directive/repeat/repeat.spec.js +135 -8
- package/src/directive/script/script.spec.js +2 -0
- package/src/directive/select/select.js +3 -3
- package/src/directive/select/select.spec.js +96 -0
- package/src/directive/show-hide/show-hide.js +2 -2
- package/src/directive/show-hide/show-hide.spec.js +19 -8
- package/src/directive/style/style.spec.js +7 -0
- package/src/directive/switch/switch.spec.js +5 -5
- package/src/directive/validators/validators.spec.js +1 -0
- package/src/loader.js +1 -0
- package/src/public.js +10 -2
- package/src/router/common/coreservices.js +2 -0
- package/src/router/directives/state-directives.js +14 -6
- package/src/router/directives/state-directives.spec.js +83 -0
- package/src/router/directives/view-directive.js +13 -4
- package/src/router/directives/view-directive.spec.js +71 -25
- package/src/router/hooks/lazy-load.js +2 -2
- package/src/router/hooks/views.js +5 -3
- package/src/router/resolve/resolvable.js +6 -3
- package/src/router/resolve/resolve-context.js +2 -2
- package/src/router/state/state-service.js +4 -4
- package/src/router/state/state.spec.js +5 -2
- package/src/router/state/state.test.js +1 -1
- package/src/router/state/views.js +10 -7
- package/src/router/template-factory.js +6 -3
- package/src/router/template-factory.spec.js +4 -0
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/view-hook.spec.js +2 -2
- package/src/router/view-scroll.js +6 -4
- package/src/services/browser.js +5 -8
- package/src/services/http/http.js +9 -6
- package/src/services/http/http.spec.js +31 -30
- package/src/services/http/template-request.spec.js +10 -0
- package/src/services/http-backend/http-backend.spec.js +3 -3
- package/src/services/template-request.js +4 -2
- package/src/shared/common.js +2 -1
- package/types/core/location/location.d.ts +37 -34
- package/types/core/parse/parse.d.ts +0 -26
- package/types/core/scope/scope.d.ts +11 -11
- package/src/core/model/model.js +0 -944
- package/src/core/model/model.spec.js +0 -3012
- package/types/core/model/model.d.ts +0 -204
|
@@ -785,7 +785,7 @@ describe("$location", () => {
|
|
|
785
785
|
// $browser,
|
|
786
786
|
// "url",
|
|
787
787
|
// ).and.callThrough();
|
|
788
|
-
// ;
|
|
788
|
+
// $rootScope.$digest();
|
|
789
789
|
// expect($browserUrl).not.toHaveBeenCalled();
|
|
790
790
|
// });
|
|
791
791
|
// });
|
|
@@ -815,7 +815,7 @@ describe("$location", () => {
|
|
|
815
815
|
// }
|
|
816
816
|
// });
|
|
817
817
|
// expect($browser.url()).toEqual("http://server/base/#!/home");
|
|
818
|
-
// ;
|
|
818
|
+
// $rootScope.$digest();
|
|
819
819
|
// expect(handlerCalled).toEqual(true);
|
|
820
820
|
// expect($browser.url()).toEqual("http://server/base/#!/");
|
|
821
821
|
// });
|
|
@@ -829,7 +829,7 @@ describe("$location", () => {
|
|
|
829
829
|
// });
|
|
830
830
|
// inject(($location, $browser, $rootScope) => {
|
|
831
831
|
// expect(() => {
|
|
832
|
-
// ;
|
|
832
|
+
// $rootScope.$digest();
|
|
833
833
|
// }).not.toThrow();
|
|
834
834
|
// });
|
|
835
835
|
// });
|
|
@@ -843,7 +843,7 @@ describe("$location", () => {
|
|
|
843
843
|
// });
|
|
844
844
|
// inject(($location, $browser, $rootScope) => {
|
|
845
845
|
// expect(() => {
|
|
846
|
-
// ;
|
|
846
|
+
// $rootScope.$digest();
|
|
847
847
|
// }).not.toThrow();
|
|
848
848
|
// });
|
|
849
849
|
// });
|
|
@@ -857,7 +857,7 @@ describe("$location", () => {
|
|
|
857
857
|
// });
|
|
858
858
|
// inject(($location, $browser, $rootScope) => {
|
|
859
859
|
// expect(() => {
|
|
860
|
-
// ;
|
|
860
|
+
// $rootScope.$digest();
|
|
861
861
|
// }).not.toThrow();
|
|
862
862
|
// });
|
|
863
863
|
// });
|
|
@@ -867,10 +867,10 @@ describe("$location", () => {
|
|
|
867
867
|
// initService({ html5Mode: true, supportHistory: true });
|
|
868
868
|
// mockUpBrowser({ initialUrl: "http://localhost:9876/", baseHref: "/" });
|
|
869
869
|
// inject(($location, $browser, $rootScope) => {
|
|
870
|
-
// ;
|
|
870
|
+
// $rootScope.$digest();
|
|
871
871
|
// $browser.url("http://localhost:9876/?q='");
|
|
872
872
|
// expect(() => {
|
|
873
|
-
// ;
|
|
873
|
+
// $rootScope.$digest();
|
|
874
874
|
// }).not.toThrow();
|
|
875
875
|
// });
|
|
876
876
|
// });
|
|
@@ -880,7 +880,7 @@ describe("$location", () => {
|
|
|
880
880
|
// initService({ html5Mode: true, supportHistory: true });
|
|
881
881
|
// mockUpBrowser({ initialUrl: "http://localhost:9876/", baseHref: "/" });
|
|
882
882
|
// inject(($window, $location, $browser, $rootScope) => {
|
|
883
|
-
// ;
|
|
883
|
+
// $rootScope.$digest();
|
|
884
884
|
// $window.location.href = "http://localhost:9876/?q='";
|
|
885
885
|
// expect(() => {
|
|
886
886
|
// JQLite($window).triggerHandler("popstate");
|
|
@@ -901,7 +901,7 @@ describe("$location", () => {
|
|
|
901
901
|
// $window,
|
|
902
902
|
// ) => {
|
|
903
903
|
// $location.url("baz");
|
|
904
|
-
// ;
|
|
904
|
+
// $rootScope.$digest();
|
|
905
905
|
|
|
906
906
|
// const originalUrl = $window.location.href;
|
|
907
907
|
|
|
@@ -931,7 +931,7 @@ describe("$location", () => {
|
|
|
931
931
|
// $window,
|
|
932
932
|
// ) => {
|
|
933
933
|
// $location.url("baz");
|
|
934
|
-
// ;
|
|
934
|
+
// $rootScope.$digest();
|
|
935
935
|
|
|
936
936
|
// $rootScope.$apply(() => {
|
|
937
937
|
// $rootScope.$evalAsync(() => {
|
|
@@ -969,7 +969,7 @@ describe("$location", () => {
|
|
|
969
969
|
|
|
970
970
|
// updatePathOnLocationChangeSuccessTo("/Home");
|
|
971
971
|
|
|
972
|
-
// ;
|
|
972
|
+
// $rootScope.$digest();
|
|
973
973
|
|
|
974
974
|
// expect($browser.url()).toEqual("http://server/app/#!/Home");
|
|
975
975
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -991,7 +991,7 @@ describe("$location", () => {
|
|
|
991
991
|
|
|
992
992
|
// updatePathOnLocationChangeSuccessTo("/");
|
|
993
993
|
|
|
994
|
-
// ;
|
|
994
|
+
// $rootScope.$digest();
|
|
995
995
|
|
|
996
996
|
// expect($browser.url()).toEqual("http://server/app/#!/");
|
|
997
997
|
// expect($location.path()).toEqual("/");
|
|
@@ -1014,7 +1014,7 @@ describe("$location", () => {
|
|
|
1014
1014
|
// ).and.callThrough();
|
|
1015
1015
|
|
|
1016
1016
|
// updatePathOnLocationChangeSuccessTo("/Home");
|
|
1017
|
-
// ;
|
|
1017
|
+
// $rootScope.$digest();
|
|
1018
1018
|
|
|
1019
1019
|
// expect($browser.url()).toEqual("http://server/app/#!/Home");
|
|
1020
1020
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -1037,7 +1037,7 @@ describe("$location", () => {
|
|
|
1037
1037
|
// ).and.callThrough();
|
|
1038
1038
|
|
|
1039
1039
|
// updatePathOnLocationChangeSuccessTo("/");
|
|
1040
|
-
// ;
|
|
1040
|
+
// $rootScope.$digest();
|
|
1041
1041
|
|
|
1042
1042
|
// expect($browser.url()).toEqual("http://server/app/#!/");
|
|
1043
1043
|
// expect($location.path()).toEqual("/");
|
|
@@ -1059,7 +1059,7 @@ describe("$location", () => {
|
|
|
1059
1059
|
// const $location = $injector.get("$location");
|
|
1060
1060
|
// updatePathOnLocationChangeSuccessTo("/Home");
|
|
1061
1061
|
|
|
1062
|
-
// ;
|
|
1062
|
+
// $rootScope.$digest();
|
|
1063
1063
|
|
|
1064
1064
|
// expect($browser.url()).toEqual("http://server/app/Home");
|
|
1065
1065
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -1079,7 +1079,7 @@ describe("$location", () => {
|
|
|
1079
1079
|
// const $location = $injector.get("$location");
|
|
1080
1080
|
// updatePathOnLocationChangeSuccessTo("/");
|
|
1081
1081
|
|
|
1082
|
-
// ;
|
|
1082
|
+
// $rootScope.$digest();
|
|
1083
1083
|
|
|
1084
1084
|
// expect($browser.url()).toEqual("http://server/app/");
|
|
1085
1085
|
// expect($location.path()).toEqual("/");
|
|
@@ -1099,7 +1099,7 @@ describe("$location", () => {
|
|
|
1099
1099
|
// const $location = $injector.get("$location");
|
|
1100
1100
|
// updatePathOnLocationChangeSuccessTo("/Home");
|
|
1101
1101
|
|
|
1102
|
-
// ;
|
|
1102
|
+
// $rootScope.$digest();
|
|
1103
1103
|
|
|
1104
1104
|
// expect($browser.url()).toEqual("http://server/app/Home");
|
|
1105
1105
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -1119,7 +1119,7 @@ describe("$location", () => {
|
|
|
1119
1119
|
// const $location = $injector.get("$location");
|
|
1120
1120
|
// updatePathOnLocationChangeSuccessTo("/");
|
|
1121
1121
|
|
|
1122
|
-
// ;
|
|
1122
|
+
// $rootScope.$digest();
|
|
1123
1123
|
|
|
1124
1124
|
// expect($browser.url()).toEqual("http://server/app/");
|
|
1125
1125
|
// expect($location.path()).toEqual("/");
|
|
@@ -1140,7 +1140,7 @@ describe("$location", () => {
|
|
|
1140
1140
|
// const $location = $injector.get("$location");
|
|
1141
1141
|
// updatePathOnLocationChangeSuccessTo("/", { q: "'" });
|
|
1142
1142
|
|
|
1143
|
-
// ;
|
|
1143
|
+
// $rootScope.$digest();
|
|
1144
1144
|
|
|
1145
1145
|
// expect($location.path()).toEqual("/");
|
|
1146
1146
|
// expect($location.search()).toEqual({ q: "'" });
|
|
@@ -1200,7 +1200,7 @@ describe("$location", () => {
|
|
|
1200
1200
|
// }
|
|
1201
1201
|
// });
|
|
1202
1202
|
|
|
1203
|
-
// ;
|
|
1203
|
+
// $rootScope.$digest();
|
|
1204
1204
|
// expect($location.absUrl()).toBe(NEW_URL);
|
|
1205
1205
|
// });
|
|
1206
1206
|
// });
|
|
@@ -1299,7 +1299,7 @@ describe("$location", () => {
|
|
|
1299
1299
|
// },
|
|
1300
1300
|
// );
|
|
1301
1301
|
|
|
1302
|
-
// ;
|
|
1302
|
+
// $rootScope.$digest();
|
|
1303
1303
|
// expect($browser.url()).toBe("http://new.com/a/b#!/changed");
|
|
1304
1304
|
// });
|
|
1305
1305
|
// });
|
|
@@ -1310,7 +1310,7 @@ describe("$location", () => {
|
|
|
1310
1310
|
// inject(($rootScope, $browser, $location) => {
|
|
1311
1311
|
// $location.hash("test");
|
|
1312
1312
|
|
|
1313
|
-
// ;
|
|
1313
|
+
// $rootScope.$digest();
|
|
1314
1314
|
// expect($browser.url()).toBe("http://new.com/a/b##test");
|
|
1315
1315
|
// });
|
|
1316
1316
|
// });
|
|
@@ -1334,7 +1334,7 @@ describe("$location", () => {
|
|
|
1334
1334
|
// mockUpBrowser({ initialUrl: "http://new.com/a/b/", baseHref: "/a/b/" });
|
|
1335
1335
|
// inject(($location, $rootScope, $window) => {
|
|
1336
1336
|
// $window.history.pushState({ b: 3 });
|
|
1337
|
-
// ;
|
|
1337
|
+
// $rootScope.$digest();
|
|
1338
1338
|
|
|
1339
1339
|
// expect($location.state()).toEqual({ b: 3 });
|
|
1340
1340
|
|
|
@@ -1343,7 +1343,7 @@ describe("$location", () => {
|
|
|
1343
1343
|
// null,
|
|
1344
1344
|
// `${$window.location.href}c?d=e#f`,
|
|
1345
1345
|
// );
|
|
1346
|
-
// ;
|
|
1346
|
+
// $rootScope.$digest();
|
|
1347
1347
|
|
|
1348
1348
|
// expect($location.path()).toBe("/c");
|
|
1349
1349
|
// expect($location.search()).toEqual({ d: "e" });
|
|
@@ -1358,10 +1358,10 @@ describe("$location", () => {
|
|
|
1358
1358
|
// mockUpBrowser({ initialUrl: "http://server/app/", baseHref: "/app/" });
|
|
1359
1359
|
// inject(($rootScope, $injector, $window) => {
|
|
1360
1360
|
// const $location = $injector.get("$location");
|
|
1361
|
-
// ; // allow $location initialization to finish
|
|
1361
|
+
// $rootScope.$digest(); // allow $location initialization to finish
|
|
1362
1362
|
|
|
1363
1363
|
// $window.history.pushState({}, null, "http://server/app/Home?q='");
|
|
1364
|
-
// ;
|
|
1364
|
+
// $rootScope.$digest();
|
|
1365
1365
|
|
|
1366
1366
|
// expect($location.absUrl()).toEqual("http://server/app/Home?q='");
|
|
1367
1367
|
// expect($location.path()).toEqual("/Home");
|
|
@@ -1375,7 +1375,7 @@ describe("$location", () => {
|
|
|
1375
1375
|
// mockUpBrowser({ initialUrl: "http://server/app/", baseHref: "/app/" });
|
|
1376
1376
|
// inject(($rootScope, $injector, $window) => {
|
|
1377
1377
|
// const $location = $injector.get("$location");
|
|
1378
|
-
// ; // allow $location initialization to finish
|
|
1378
|
+
// $rootScope.$digest(); // allow $location initialization to finish
|
|
1379
1379
|
|
|
1380
1380
|
// $window.location.href = "http://server/app/Home?q='";
|
|
1381
1381
|
// JQLite($window).triggerHandler("popstate");
|
package/src/core/on.spec.js
CHANGED
|
@@ -101,6 +101,7 @@ describe("ngOn* event binding", () => {
|
|
|
101
101
|
$rootScope,
|
|
102
102
|
);
|
|
103
103
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
104
|
+
$rootScope.$digest();
|
|
104
105
|
element.triggerHandler("asdf");
|
|
105
106
|
expect(cb).toHaveBeenCalled();
|
|
106
107
|
expect(element.attr("asdf")).toBe("foo");
|
|
@@ -111,6 +112,7 @@ describe("ngOn* event binding", () => {
|
|
|
111
112
|
$rootScope,
|
|
112
113
|
);
|
|
113
114
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
115
|
+
$rootScope.$digest();
|
|
114
116
|
element.triggerHandler("asdf");
|
|
115
117
|
expect(cb).toHaveBeenCalled();
|
|
116
118
|
expect(element.attr("asdf")).toBe("foo");
|
|
@@ -121,6 +123,7 @@ describe("ngOn* event binding", () => {
|
|
|
121
123
|
$rootScope,
|
|
122
124
|
);
|
|
123
125
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
126
|
+
$rootScope.$digest();
|
|
124
127
|
element.triggerHandler("asdf");
|
|
125
128
|
expect(cb).toHaveBeenCalled();
|
|
126
129
|
expect(element[0].asdf).toBe(123);
|
|
@@ -194,6 +197,8 @@ describe("ngOn* event binding", () => {
|
|
|
194
197
|
it("should correctly bind to kebab-cased event names", () => {
|
|
195
198
|
const element = $compile('<span ng-on-foo-bar="cb()"></span>')($rootScope);
|
|
196
199
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
200
|
+
$rootScope.$digest();
|
|
201
|
+
|
|
197
202
|
element.triggerHandler("foobar");
|
|
198
203
|
element.triggerHandler("fooBar");
|
|
199
204
|
expect(cb).not.toHaveBeenCalled();
|
|
@@ -205,6 +210,8 @@ describe("ngOn* event binding", () => {
|
|
|
205
210
|
it("should correctly bind to camelCased event names", () => {
|
|
206
211
|
const element = $compile('<span ng-on-foo_bar="cb()"></span>')($rootScope);
|
|
207
212
|
const cb = ($rootScope.cb = jasmine.createSpy("ng-on cb"));
|
|
213
|
+
$rootScope.$digest();
|
|
214
|
+
|
|
208
215
|
element.triggerHandler("foobar");
|
|
209
216
|
element.triggerHandler("foo-bar");
|
|
210
217
|
element.triggerHandler("foo-bar");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDefined
|
|
1
|
+
import { isDefined } from "../../shared/utils";
|
|
2
2
|
import { ASTType } from "./ast-type";
|
|
3
3
|
|
|
4
4
|
export const PURITY_ABSOLUTE = 1;
|
|
@@ -66,7 +66,6 @@ export class ASTInterpreter {
|
|
|
66
66
|
if (inputs) {
|
|
67
67
|
fn.inputs = inputs;
|
|
68
68
|
}
|
|
69
|
-
fn.decoratedNode = decoratedNode;
|
|
70
69
|
return fn;
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -135,10 +134,9 @@ export class ASTInterpreter {
|
|
|
135
134
|
? function (scope, locals, assign) {
|
|
136
135
|
const values = [];
|
|
137
136
|
for (let i = 0; i < args.length; ++i) {
|
|
138
|
-
|
|
139
|
-
values.push(isFunction(res) ? res() : res);
|
|
137
|
+
values.push(args[i](scope, locals, assign));
|
|
140
138
|
}
|
|
141
|
-
const value =
|
|
139
|
+
const value = right.apply(undefined, values);
|
|
142
140
|
return context
|
|
143
141
|
? { context: undefined, name: undefined, value }
|
|
144
142
|
: value;
|
|
@@ -146,11 +144,10 @@ export class ASTInterpreter {
|
|
|
146
144
|
: function (scope, locals, assign) {
|
|
147
145
|
const rhs = right(scope, locals, assign);
|
|
148
146
|
let value;
|
|
149
|
-
if (rhs.value != null
|
|
147
|
+
if (rhs.value != null) {
|
|
150
148
|
const values = [];
|
|
151
149
|
for (let i = 0; i < args.length; ++i) {
|
|
152
|
-
|
|
153
|
-
values.push(isFunction(res) ? res() : res);
|
|
150
|
+
values.push(args[i](scope, locals, assign));
|
|
154
151
|
}
|
|
155
152
|
value = rhs.value.apply(rhs.context, values);
|
|
156
153
|
}
|
|
@@ -813,8 +810,8 @@ function assignableAST(ast) {
|
|
|
813
810
|
}
|
|
814
811
|
|
|
815
812
|
function plusFn(l, r) {
|
|
816
|
-
if (typeof l === "undefined"
|
|
817
|
-
if (typeof r === "undefined"
|
|
813
|
+
if (typeof l === "undefined") return r;
|
|
814
|
+
if (typeof r === "undefined") return l;
|
|
818
815
|
return l + r;
|
|
819
816
|
}
|
|
820
817
|
|
package/src/core/parse/parse.js
CHANGED
|
@@ -9,21 +9,11 @@ import { Parser } from "./parser/parser.js";
|
|
|
9
9
|
* @property {boolean} constant - Indicates if the expression is constant.
|
|
10
10
|
* @property {boolean} [isPure]
|
|
11
11
|
* @property {boolean} oneTime
|
|
12
|
-
* @property {import("./interpreter.js").DecoratedASTNode} decoratedNode
|
|
13
12
|
* @property {function(import('../scope/scope').Scope, import('../scope/scope').WatchListener, boolean, CompiledExpression, string | ((scope: import('../scope/scope').Scope) => any) | CompiledExpression): any} [$$watchDelegate]
|
|
14
13
|
* @property {any[]|Function} inputs
|
|
15
14
|
* @property {function(any, any): any} [assign] - Assigns a value to a context. If value is not provided,
|
|
16
15
|
*/
|
|
17
16
|
|
|
18
|
-
/**
|
|
19
|
-
* @typedef {Object} CompiledExpressionHandlerMap
|
|
20
|
-
* @property {boolean} literal - Indicates if the expression is a literal.
|
|
21
|
-
* @property {boolean} constant - Indicates if the expression is constant.
|
|
22
|
-
* @property {boolean} [isPure]
|
|
23
|
-
* @property {boolean} oneTime
|
|
24
|
-
* @property {Map<string, Function>} keyMap - property keys to observe
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* @typedef {Function} CompiledExpressionFunction
|
|
29
19
|
* @param {import('../scope/scope').Scope} context - An object against which any expressions embedded in the strings are evaluated against (typically a scope object).
|
|
@@ -133,24 +123,14 @@ export function ParseProvider() {
|
|
|
133
123
|
parsedExpression = parsedExpression.$$intercepted;
|
|
134
124
|
}
|
|
135
125
|
|
|
136
|
-
|
|
126
|
+
var useInputs = false;
|
|
137
127
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
locals,
|
|
141
|
-
assign,
|
|
142
|
-
inputs,
|
|
143
|
-
) {
|
|
144
|
-
const value =
|
|
128
|
+
var fn = function interceptedExpression(scope, locals, assign, inputs) {
|
|
129
|
+
var value =
|
|
145
130
|
useInputs && inputs
|
|
146
131
|
? inputs[0]
|
|
147
132
|
: parsedExpression(scope, locals, assign, inputs);
|
|
148
|
-
|
|
149
|
-
if (scope.getter) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const res = isFunction(value) ? value() : value;
|
|
153
|
-
return interceptorFn(res);
|
|
133
|
+
return interceptorFn(value);
|
|
154
134
|
};
|
|
155
135
|
|
|
156
136
|
// Maintain references to the interceptor/intercepted
|
|
@@ -161,7 +141,6 @@ export function ParseProvider() {
|
|
|
161
141
|
fn.literal = parsedExpression.literal;
|
|
162
142
|
fn.oneTime = parsedExpression.oneTime;
|
|
163
143
|
fn.constant = parsedExpression.constant;
|
|
164
|
-
fn.decoratedNode = parsedExpression.decoratedNode;
|
|
165
144
|
|
|
166
145
|
// Treat the interceptor like filters.
|
|
167
146
|
// If it is not $stateful then only watch its inputs.
|
|
@@ -349,7 +328,7 @@ function oneTimeWatchDelegate(
|
|
|
349
328
|
lastValue =
|
|
350
329
|
useInputs && inputs ? inputs[0] : exp(scope, locals, assign, inputs);
|
|
351
330
|
if (isDone(lastValue)) {
|
|
352
|
-
scope
|
|
331
|
+
scope.$$postDigest(unwatchIfDone);
|
|
353
332
|
}
|
|
354
333
|
return post(lastValue);
|
|
355
334
|
}
|