@angular-wave/angular.ts 0.4.2 → 0.4.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.
Files changed (150) hide show
  1. package/dist/angular-ts.esm.js +2 -2
  2. package/dist/angular-ts.umd.js +12 -2
  3. package/index.html +74 -3
  4. package/package.json +7 -7
  5. package/src/angular.spec.js +1 -269
  6. package/src/animations/animate-css-driver.js +2 -2
  7. package/src/animations/animate-css.js +12 -21
  8. package/src/animations/animate-js-driver.js +1 -3
  9. package/src/animations/animate-js.js +4 -4
  10. package/src/animations/animate-queue.js +23 -23
  11. package/src/animations/animate-runner.js +4 -8
  12. package/src/animations/animate.md +1 -1
  13. package/src/animations/animate.spec.js +0 -21
  14. package/src/animations/animation.js +4 -4
  15. package/src/animations/shared.js +14 -12
  16. package/src/binding.spec.js +0 -1
  17. package/src/core/cache/cache.js +2 -29
  18. package/src/core/compile/attributes.js +2 -3
  19. package/src/core/compile/compile.js +260 -245
  20. package/src/core/compile/compile.spec.js +63 -317
  21. package/src/core/compile/compile.test.js +1 -1
  22. package/src/core/controller/controller.js +2 -0
  23. package/src/core/di/injector.md +1 -1
  24. package/src/core/di/injector.spec.js +0 -2
  25. package/src/core/di/internal-injector.js +2 -1
  26. package/src/core/interpolate/interpolate.js +16 -3
  27. package/src/core/interpolate/interpolate.spec.js +70 -16
  28. package/src/core/location/location.js +0 -2
  29. package/src/core/location/location.spec.js +27 -27
  30. package/src/core/{scope/scope.html → model/model.html} +1 -1
  31. package/src/core/model/model.js +944 -0
  32. package/src/core/model/model.spec.js +3012 -0
  33. package/src/core/on.spec.js +0 -7
  34. package/src/core/parse/interpreter.js +10 -7
  35. package/src/core/parse/parse.js +28 -7
  36. package/src/core/parse/parse.spec.js +95 -91
  37. package/src/core/prop.spec.js +4 -60
  38. package/src/core/sce/sce.js +1 -2
  39. package/src/core/sce/sce.spec.js +0 -8
  40. package/src/core/scope/scope.js +62 -32
  41. package/src/core/scope/scope.spec.js +25 -1960
  42. package/src/directive/aria/aria.js +3 -6
  43. package/src/directive/aria/aria.spec.js +0 -87
  44. package/src/directive/attrs/attrs.spec.js +0 -5
  45. package/src/directive/{list/list.test.js → attrs/attrs.test.js} +1 -1
  46. package/src/{core/q/q.html → directive/attrs/boolean.html} +1 -1
  47. package/src/directive/attrs/boolean.spec.js +0 -15
  48. package/src/{core/q/q.test.js → directive/attrs/boolean.test.js} +1 -2
  49. package/src/{core/timeout/timeout.html → directive/attrs/element-style.html} +4 -1
  50. package/src/directive/attrs/element-style.spec.js +0 -8
  51. package/src/{core/scope/scope.test.js → directive/attrs/element-style.test.js} +1 -2
  52. package/src/directive/attrs/src.spec.js +0 -7
  53. package/src/directive/bind/bind.spec.js +0 -33
  54. package/src/directive/bind/bing-html.spec.js +1 -4
  55. package/src/{core/interval/interval.html → directive/channel/channel.html} +1 -1
  56. package/src/directive/channel/channel.js +29 -0
  57. package/src/directive/channel/channel.spec.js +52 -0
  58. package/src/directive/channel/channel.test.js +9 -0
  59. package/src/directive/class/class.js +3 -3
  60. package/src/directive/class/class.spec.js +9 -75
  61. package/src/directive/controller/controller.spec.js +0 -13
  62. package/src/directive/events/click.spec.js +0 -3
  63. package/src/directive/events/event.spec.js +0 -6
  64. package/src/directive/form/form.js +14 -22
  65. package/src/directive/form/form.spec.js +0 -65
  66. package/src/directive/if/if.spec.js +2 -7
  67. package/src/directive/if/if.test.js +1 -2
  68. package/src/directive/include/include.js +2 -2
  69. package/src/directive/include/include.spec.js +8 -59
  70. package/src/directive/init/init.js +6 -2
  71. package/src/directive/init/init.spec.js +0 -2
  72. package/src/directive/input/input.js +1 -2
  73. package/src/directive/input/input.spec.js +191 -331
  74. package/src/directive/messages/messages.spec.js +4 -35
  75. package/src/directive/model/model.js +30 -42
  76. package/src/directive/model/model.spec.js +2 -49
  77. package/src/directive/model-options/model-options.js +22 -26
  78. package/src/directive/model-options/model-options.spec.js +0 -6
  79. package/src/directive/non-bindable/non-bindable.spec.js +0 -1
  80. package/src/directive/observe/observe.js +0 -1
  81. package/src/directive/observe/observe.spec.js +0 -1
  82. package/src/directive/options/options.js +1 -3
  83. package/src/directive/options/options.spec.js +3 -38
  84. package/src/directive/ref/href.spec.js +0 -15
  85. package/src/directive/repeat/repeat.js +2 -2
  86. package/src/directive/repeat/repeat.spec.js +56 -192
  87. package/src/directive/script/script.spec.js +0 -2
  88. package/src/directive/select/select.js +3 -3
  89. package/src/directive/select/select.spec.js +9 -106
  90. package/src/directive/show-hide/show-hide.js +2 -2
  91. package/src/directive/show-hide/show-hide.spec.js +8 -19
  92. package/src/directive/style/style.spec.js +0 -7
  93. package/src/directive/switch/switch.js +1 -2
  94. package/src/directive/switch/switch.spec.js +5 -5
  95. package/src/directive/validators/validators.spec.js +0 -1
  96. package/src/loader.js +0 -1
  97. package/src/public.js +75 -80
  98. package/src/router/common/coreservices.js +0 -2
  99. package/src/router/directives/state-directives.js +24 -30
  100. package/src/router/directives/state-directives.spec.js +0 -83
  101. package/src/router/directives/view-directive.js +6 -15
  102. package/src/router/directives/view-directive.spec.js +25 -71
  103. package/src/router/hooks/lazy-load.js +2 -2
  104. package/src/router/hooks/views.js +3 -5
  105. package/src/router/resolve/resolvable.js +3 -6
  106. package/src/router/resolve/resolve-context.js +2 -2
  107. package/src/router/state/state-service.js +4 -4
  108. package/src/router/state/state.spec.js +2 -5
  109. package/src/router/state/views.js +9 -12
  110. package/src/router/template-factory.js +3 -6
  111. package/src/router/template-factory.spec.js +0 -4
  112. package/src/router/transition/transition-hook.js +1 -1
  113. package/src/router/transition/transition.js +1 -1
  114. package/src/router/url/url-service.js +2 -8
  115. package/src/router/url/url-service.spec.js +3 -4
  116. package/src/router/view-hook.spec.js +2 -2
  117. package/src/router/view-scroll.js +4 -6
  118. package/src/services/http/http.js +11 -15
  119. package/src/services/http/http.spec.js +30 -31
  120. package/src/services/http/template-request.spec.js +0 -10
  121. package/src/services/http-backend/http-backend.js +19 -17
  122. package/src/services/http-backend/http-backend.spec.js +3 -3
  123. package/src/services/template-request.js +2 -4
  124. package/src/shared/common.js +6 -10
  125. package/src/shared/jqlite/jqlite.js +14 -15
  126. package/src/shared/jqlite/jqlite.spec.js +2 -2
  127. package/src/shared/utils.js +15 -92
  128. package/types/core/cache/cache.d.ts +1 -1
  129. package/types/core/model/model.d.ts +204 -0
  130. package/types/core/parse/parse.d.ts +26 -0
  131. package/types/core/scope/scope.d.ts +22 -21
  132. package/types/directive/channel/channel.d.ts +11 -0
  133. package/types/directive/form/form.d.ts +1 -0
  134. package/types/shared/common.d.ts +0 -1
  135. package/types/shared/utils.d.ts +0 -35
  136. package/src/core/interval/interval-factory.js +0 -50
  137. package/src/core/interval/interval.js +0 -77
  138. package/src/core/interval/interval.md +0 -123
  139. package/src/core/interval/interval.spec.js +0 -280
  140. package/src/core/q/q.js +0 -472
  141. package/src/core/q/q.md +0 -211
  142. package/src/core/q/q.spec.js +0 -2748
  143. package/src/core/timeout/timeout.js +0 -109
  144. package/src/core/timeout/timeout.spec.js +0 -354
  145. package/src/core/timeout/timout.test.js +0 -12
  146. package/src/directive/list/list.html +0 -18
  147. package/src/directive/list/list.js +0 -46
  148. package/src/directive/list/list.md +0 -22
  149. package/src/directive/list/list.spec.js +0 -172
  150. package/types/directive/list/list.d.ts +0 -4
@@ -1,7 +1,6 @@
1
1
  import { getOrSetCacheData, JQLite } from "../shared/jqlite/jqlite";
2
2
  import {
3
3
  isUndefined,
4
- forEach,
5
4
  isObject,
6
5
  isString,
7
6
  isElement,
@@ -183,7 +182,7 @@ export function AnimateQueueProvider($animateProvider) {
183
182
  if (postDigestCalled) {
184
183
  fn();
185
184
  } else {
186
- $rootScope.$$postDigest(() => {
185
+ $rootScope.$postUpdate(() => {
187
186
  postDigestCalled = true;
188
187
  fn();
189
188
  });
@@ -195,29 +194,30 @@ export function AnimateQueueProvider($animateProvider) {
195
194
  // compiled. The $templateRequest.totalPendingRequests variable keeps track of
196
195
  // all of the remote templates being currently downloaded. If there are no
197
196
  // templates currently downloading then the watcher will still fire anyway.
198
- $rootScope["$templateRequest"] = $templateRequest;
197
+ $rootScope["templateRequest"] = $templateRequest;
199
198
  const deregisterWatch = $rootScope.$watch(
200
199
  "$templateRequest.totalPendingRequests",
201
200
  (val) => {
202
- if (val !== 0) return;
203
- deregisterWatch();
204
- $rootScope["$templateRequest"] = undefined;
205
- // Now that all templates have been downloaded, $animate will wait until
206
- // the post digest queue is empty before enabling animations. By having two
207
- // calls to $postDigest calls we can ensure that the flag is enabled at the
208
- // very end of the post digest queue. Since all of the animations in $animate
209
- // use $postDigest, it's important that the code below executes at the end.
210
- // This basically means that the page is fully downloaded and compiled before
211
- // any animations are triggered.
212
- $rootScope.$$postDigest(() => {
213
- $rootScope.$$postDigest(() => {
214
- // we check for null directly in the event that the application already called
215
- // .enabled() with whatever arguments that it provided it with
216
- if (animationsEnabled === null) {
217
- animationsEnabled = true;
218
- }
201
+ if (val === 0) {
202
+ deregisterWatch();
203
+ $rootScope["$templateRequest"] = undefined;
204
+ // Now that all templates have been downloaded, $animate will wait until
205
+ // the post digest queue is empty before enabling animations. By having two
206
+ // calls to $postDigest calls we can ensure that the flag is enabled at the
207
+ // very end of the post digest queue. Since all of the animations in $animate
208
+ // use $postDigest, it's important that the code below executes at the end.
209
+ // This basically means that the page is fully downloaded and compiled before
210
+ // any animations are triggered.
211
+ $rootScope.$postUpdate(() => {
212
+ $rootScope.$postUpdate(() => {
213
+ // we check for null directly in the event that the application already called
214
+ // .enabled() with whatever arguments that it provided it with
215
+ if (animationsEnabled === null) {
216
+ animationsEnabled = true;
217
+ }
218
+ });
219
219
  });
220
- });
220
+ }
221
221
  },
222
222
  );
223
223
 
@@ -598,7 +598,7 @@ export function AnimateQueueProvider($animateProvider) {
598
598
 
599
599
  markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);
600
600
 
601
- $rootScope.$$postDigest(() => {
601
+ $rootScope.$postUpdate(() => {
602
602
  // It is possible that the DOM nodes inside `originalElement` have been replaced. This can
603
603
  // happen if the animated element is a transcluded clone and also has a `templateUrl`
604
604
  // directive on it. Therefore, we must recreate `element` in order to interact with the
@@ -718,7 +718,7 @@ export function AnimateQueueProvider($animateProvider) {
718
718
 
719
719
  function closeChildAnimations(node) {
720
720
  const children = node.querySelectorAll(`[${NG_ANIMATE_ATTR_NAME}]`);
721
- forEach(children, (child) => {
721
+ children.forEach((child) => {
722
722
  const state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);
723
723
  const animationDetails = activeAnimationsLookup.get(child);
724
724
  if (animationDetails) {
@@ -34,17 +34,13 @@ export function AnimateAsyncRunFactoryProvider() {
34
34
  const INITIAL_STATE = 0;
35
35
  const DONE_PENDING_STATE = 1;
36
36
  const DONE_COMPLETE_STATE = 2;
37
- let $q, $$animateAsyncRun, $timeout;
37
+ let $$animateAsyncRun;
38
38
 
39
39
  export function AnimateRunnerFactoryProvider() {
40
40
  this.$get = [
41
- "$q",
42
41
  "$$animateAsyncRun",
43
- "$timeout",
44
- function (q, animateAsyncRun, timeout) {
45
- $q = q;
42
+ function (animateAsyncRun) {
46
43
  $$animateAsyncRun = animateAsyncRun;
47
- $timeout = timeout;
48
44
  return AnimateRunner;
49
45
  },
50
46
  ];
@@ -94,7 +90,7 @@ export class AnimateRunner {
94
90
 
95
91
  const rafTick = $$animateAsyncRun();
96
92
  const timeoutTick = (fn) => {
97
- $timeout(fn, 0, false);
93
+ setTimeout(fn, 0, false);
98
94
  };
99
95
 
100
96
  this._doneCallbacks = [];
@@ -125,7 +121,7 @@ export class AnimateRunner {
125
121
  getPromise() {
126
122
  if (!this.promise) {
127
123
  const self = this;
128
- this.promise = $q((resolve, reject) => {
124
+ this.promise = new Promise((resolve, reject) => {
129
125
  self.done((status) => {
130
126
  if (status === false) {
131
127
  reject();
@@ -259,7 +259,7 @@
259
259
  - $animate.leave(kids[5]); //stagger index=0
260
260
  - $animate.leave(kids[6]); //stagger index=1
261
261
  -
262
- - $scope.$digest();
262
+ - ;
263
263
  - });
264
264
  - ```
265
265
 
@@ -82,7 +82,6 @@ describe("$animate", () => {
82
82
  $animate.enabled(false);
83
83
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
84
84
  $animate.addClass(element, "ng-hide");
85
- $rootScope.$digest();
86
85
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
87
86
  });
88
87
 
@@ -117,10 +116,8 @@ describe("$animate", () => {
117
116
  $animate.enabled(false);
118
117
  expect(rect[0].classList.contains("ng-hide")).toBeFalse();
119
118
  $animate.addClass(rect, "ng-hide");
120
- $rootScope.$digest();
121
119
  expect(rect[0].classList.contains("ng-hide")).toBeTrue();
122
120
  $animate.removeClass(rect, "ng-hide");
123
- $rootScope.$digest();
124
121
  expect(rect[0].classList.contains("ng-hide")).toBeFalse();
125
122
  });
126
123
 
@@ -171,25 +168,21 @@ describe("$animate", () => {
171
168
  $animate.addClass(element, "on", {
172
169
  to: { color: "green" },
173
170
  });
174
- $rootScope.$digest();
175
171
  assertColor("green");
176
172
 
177
173
  $animate.setClass(element, "off", "on", {
178
174
  to: { color: "black" },
179
175
  });
180
- $rootScope.$digest();
181
176
  assertColor("black");
182
177
 
183
178
  $animate.removeClass(element, "off", {
184
179
  to: { color: "blue" },
185
180
  });
186
- $rootScope.$digest();
187
181
  assertColor("blue");
188
182
 
189
183
  $animate.leave(element, {
190
184
  to: { color: "yellow" },
191
185
  });
192
- $rootScope.$digest();
193
186
  assertColor("yellow");
194
187
 
195
188
  function assertColor(color) {
@@ -205,8 +198,6 @@ describe("$animate", () => {
205
198
  from: { color: "green" },
206
199
  to: { borderColor: "purple" },
207
200
  });
208
- $rootScope.$digest();
209
-
210
201
  const { style } = element[0];
211
202
  expect(style.color).toBe("green");
212
203
  expect(style.borderColor).toBe("purple");
@@ -217,8 +208,6 @@ describe("$animate", () => {
217
208
 
218
209
  $animate.addClass(element, "ng-hide");
219
210
  $animate.removeClass(element, "ng-hide");
220
- $rootScope.$digest();
221
-
222
211
  expect(element[0].classList.contains("ng-hide")).toBeFalse();
223
212
  });
224
213
 
@@ -227,8 +216,6 @@ describe("$animate", () => {
227
216
 
228
217
  $animate.removeClass(element, "ng-hide");
229
218
  $animate.addClass(element, "ng-hide");
230
- $rootScope.$digest();
231
-
232
219
  expect(element[0].classList.contains("ng-hide")).toBeTrue();
233
220
  });
234
221
 
@@ -338,7 +325,6 @@ describe("$animate", () => {
338
325
 
339
326
  expect(() => {
340
327
  fn();
341
- $rootScope.$digest();
342
328
  }).not.toThrow();
343
329
 
344
330
  const optionsArg = captureSpy.calls.mostRecent().args[2];
@@ -353,8 +339,6 @@ describe("$animate", () => {
353
339
 
354
340
  $animate.enter(element1, $rootElement, null, { addClass: " " });
355
341
  $animate.enter(element2, $rootElement, null, { addClass: "valid-name" });
356
- $rootScope.$digest();
357
-
358
342
  expect(element2[0].classList.contains("valid-name")).toBeTruthy();
359
343
  });
360
344
 
@@ -375,7 +359,6 @@ describe("$animate", () => {
375
359
  const runner = $animate.enter(element, parent, null, copiedOptions);
376
360
  expect(copiedOptions).toEqual(initialOptions);
377
361
 
378
- $rootScope.$digest();
379
362
  expect(copiedOptions).toEqual(initialOptions);
380
363
  });
381
364
 
@@ -418,7 +401,6 @@ describe("$animate", () => {
418
401
  $animate.removeClass(element, "test-class1");
419
402
  $animate.addClass(element, "test-class2");
420
403
  $animate.setClass(element, "test-class3", "test-class4");
421
- $rootScope.$digest();
422
404
  expect(element[0].classList.contains("test-class1")).toBeFalse();
423
405
  expect(element[0].classList.contains("test-class2")).toBeTrue();
424
406
  expect(element[0].classList.contains("test-class3")).toBeTrue();
@@ -443,7 +425,6 @@ describe("$animate", () => {
443
425
  $animate.addClass(element, "test1");
444
426
  $animate.removeClass(element, "test2");
445
427
 
446
- $rootScope.$digest();
447
428
  element = JQLite('<p class="test4">test</p>');
448
429
 
449
430
  $rootScope.$apply(() => {
@@ -486,8 +467,6 @@ describe("$animate", () => {
486
467
  $animate.addClass(target, "test-class2");
487
468
  $animate.setClass(target, "test-class3", "test-class4");
488
469
 
489
- $rootScope.$digest();
490
-
491
470
  expect(target[0].classList.contains("test-class2")).toBeTrue();
492
471
  expect(target[0].classList.contains("test-class3")).toBeTrue();
493
472
  });
@@ -1,5 +1,5 @@
1
1
  import { JQLite } from "../shared/jqlite/jqlite";
2
- import { forEach, mergeClasses } from "../shared/utils";
2
+ import { mergeClasses } from "../shared/utils";
3
3
  import {
4
4
  NG_ANIMATE_CLASSNAME,
5
5
  PREPARE_CLASS_SUFFIX,
@@ -203,7 +203,7 @@ export function AnimationProvider() {
203
203
  // were apart of the same postDigest flush call.
204
204
  if (animationQueue.length > 1) return runner;
205
205
 
206
- $rootScope.$$postDigest(() => {
206
+ $rootScope.$postUpdate(() => {
207
207
  const animations = [];
208
208
  animationQueue.forEach((entry) => {
209
209
  // the element was destroyed early on which removed the runner
@@ -326,7 +326,7 @@ export function AnimationProvider() {
326
326
  ? [node]
327
327
  : node.querySelectorAll(SELECTOR);
328
328
  const anchors = [];
329
- forEach(items, (node) => {
329
+ items.forEach((node) => {
330
330
  const attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
331
331
  if (attr && attr.length) {
332
332
  anchors.push(node);
@@ -338,7 +338,7 @@ export function AnimationProvider() {
338
338
  function groupAnimations(animations) {
339
339
  const preparedAnimations = [];
340
340
  const refLookup = {};
341
- forEach(animations, (animation, index) => {
341
+ animations.forEach((animation, index) => {
342
342
  const { element } = animation;
343
343
  const node = getDomNode(element);
344
344
  const { event } = animation;
@@ -1,4 +1,4 @@
1
- import { forEach, isString, minErr, extend } from "../shared/utils.js";
1
+ import { isString, minErr, extend } from "../shared/utils.js";
2
2
  import { JQLite } from "../shared/jqlite/jqlite.js";
3
3
  import { ASTType } from "../core/parse/ast-type.js";
4
4
 
@@ -262,12 +262,12 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
262
262
  existing = splitClassesToLookup(existing);
263
263
 
264
264
  toAdd = splitClassesToLookup(toAdd);
265
- forEach(toAdd, (value, key) => {
265
+ Object.keys(toAdd).forEach((key) => {
266
266
  flags[key] = ADD_CLASS;
267
267
  });
268
268
 
269
269
  toRemove = splitClassesToLookup(toRemove);
270
- forEach(toRemove, (value, key) => {
270
+ Object.keys(toRemove).forEach((key) => {
271
271
  flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
272
272
  });
273
273
 
@@ -276,7 +276,7 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
276
276
  removeClass: "",
277
277
  };
278
278
 
279
- forEach(flags, function (val, klass) {
279
+ Object.entries(flags).forEach(([klass, val]) => {
280
280
  var prop, allow;
281
281
  if (val === ADD_CLASS) {
282
282
  prop = "addClass";
@@ -295,17 +295,19 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
295
295
 
296
296
  function splitClassesToLookup(classes) {
297
297
  if (isString(classes)) {
298
- classes = classes.split(" ");
298
+ classes = classes.trim().split(" ");
299
299
  }
300
300
 
301
301
  const obj = {};
302
- forEach(classes, (klass) => {
303
- // sometimes the split leaves empty string values
304
- // incase extra spaces were applied to the options
305
- if (klass.length) {
306
- obj[klass] = true;
307
- }
308
- });
302
+ if (classes) {
303
+ classes.forEach((klass) => {
304
+ // sometimes the split leaves empty string values
305
+ // incase extra spaces were applied to the options
306
+ if (klass.length) {
307
+ obj[klass] = true;
308
+ }
309
+ });
310
+ }
309
311
  return obj;
310
312
  }
311
313
 
@@ -46,7 +46,6 @@ describe("binding", () => {
46
46
 
47
47
  it("BindUpdate", () => {
48
48
  $compile('<div ng-init="a=123"/>')($rootScope);
49
- $rootScope.$digest();
50
49
  expect($rootScope.a).toBe(123);
51
50
  });
52
51
 
@@ -7,7 +7,7 @@
7
7
  *
8
8
  */
9
9
 
10
- export const EXPANDO = "ngId";
10
+ export const EXPANDO = "ng";
11
11
 
12
12
  /**
13
13
  * Expando cache for adding properties to DOM nodes with JavaScript.
@@ -17,31 +17,4 @@ export const EXPANDO = "ngId";
17
17
  *
18
18
  * @type {Map<number, ExpandoStore>}
19
19
  */
20
- export const CACHE = new Proxy(new Map(), {
21
- get(target, prop, receiver) {
22
- if (prop === "size") {
23
- return target.size;
24
- }
25
- if (typeof target[prop] === "function") {
26
- return function (...args) {
27
- return target[prop].apply(target, args);
28
- };
29
- }
30
- return Reflect.get(target, prop, receiver);
31
- },
32
- set(target, prop, value, receiver) {
33
- return Reflect.set(target, prop, value, receiver);
34
- },
35
- deleteProperty(target, prop) {
36
- return Reflect.deleteProperty(target, prop);
37
- },
38
- has(target, prop) {
39
- return Reflect.has(target, prop);
40
- },
41
- ownKeys(target) {
42
- return Reflect.ownKeys(target);
43
- },
44
- getOwnPropertyDescriptor(target, prop) {
45
- return Reflect.getOwnPropertyDescriptor(target, prop);
46
- },
47
- });
20
+ export const CACHE = new Map();
@@ -1,6 +1,5 @@
1
1
  import { getBooleanAttrName } from "../../shared/jqlite/jqlite";
2
2
  import {
3
- forEach,
4
3
  isString,
5
4
  snakeCase,
6
5
  isUndefined,
@@ -179,8 +178,8 @@ export class Attributes {
179
178
 
180
179
  // fire observers
181
180
  const { $$observers } = this;
182
- if ($$observers) {
183
- forEach($$observers[observer], (fn) => {
181
+ if ($$observers && $$observers[observer]) {
182
+ $$observers[observer].forEach((fn) => {
184
183
  try {
185
184
  fn(value);
186
185
  } catch (e) {