@zvenigora/ng-eval-core 0.6.1 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zvenigora/ng-eval-core",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "An expression evaluator for Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -554,6 +554,11 @@ interface EvalScopeOptions {
554
554
  global?: boolean;
555
555
  caseInsensitive?: boolean;
556
556
  namespace?: string;
557
+ /**
558
+ * The `this` for a method called on the scope's own object (`ns.fn()`), or
559
+ * for `this.fn()` when this scope supplies `fn`. Unset, `ns.fn()` receives
560
+ * the scope's object. Applied since 0.7.0; accepted and ignored before.
561
+ */
557
562
  thisArg?: unknown;
558
563
  }
559
564
  /**
@@ -738,10 +743,22 @@ declare class EvalContext {
738
743
  */
739
744
  hasInScopes(key: unknown): boolean;
740
745
  /**
741
- * Retrieves the `this` value of the specified key from the evaluation context.
742
- * The value is searched in the original context, prior scopes, and lookup functions.
746
+ * Retrieves the `this` value a call of the specified key receives through
747
+ * `this.key()`.
748
+ *
749
+ * - A key the original context holds: the original context.
750
+ * - A key a prior scope resolves: that scope's `thisArg`, or undefined when
751
+ * it sets none. The first scope that resolves the key answers, as in
752
+ * {@link get}.
753
+ * - A key only a lookup resolves, or none: undefined. A lookup is a resolver,
754
+ * not an object that holds the key.
755
+ *
756
+ * Undefined means "no receiver of its own", and the member visitor then falls
757
+ * back to the object it was evaluating. Up to 0.6.x the prior-scope step
758
+ * re-tested the original context and could never answer, and the lookup step
759
+ * returned the lookup function itself (`docs/backlog-retired.md` A7).
743
760
  * @param key - The key to retrieve the value for.
744
- * @returns The `this` value associated with the key, or undefined if not found.
761
+ * @returns The `this` value associated with the key, or undefined.
745
762
  */
746
763
  getThis(key: unknown): unknown | undefined;
747
764
  /**
@@ -1640,10 +1657,12 @@ declare class EvalHooks {
1640
1657
  * reaching the scan.
1641
1658
  *
1642
1659
  * Popping positionally instead would be correct only if every visitor
1643
- * bracketed its body exactly. `await-expression.ts` does not - it catches a
1644
- * child's synchronous throw and continues to its own `afterVisitor` - so a
1645
- * positional pop closes the child's frame under the parent's name, drops the
1646
- * child's `after` entirely, and leaks one frame onto the state for good.
1660
+ * bracketed its body exactly. Up to 0.6.x `await-expression.ts` did not - it
1661
+ * caught a child's synchronous throw and continued to its own
1662
+ * `afterVisitor` - so a positional pop closed the child's frame under the
1663
+ * parent's name, dropped the child's `after` entirely, and leaked one frame
1664
+ * onto the state for good. Since 0.7.0 no built-in visitor does that, and the
1665
+ * identity match stays as the guard against the next one.
1647
1666
  *
1648
1667
  * The synthesised events carry no `value` (the node never pushed one) and no
1649
1668
  * `error` (nothing threw; the frames are being closed because an enclosing