@next-core/cook 2.4.0 → 2.4.1

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/esm/cook.js CHANGED
@@ -55,7 +55,7 @@ export function cook(rootAst, codeSource) {
55
55
  var _hooks$beforeEvaluate, _hooks$beforeBranch2;
56
56
  (_hooks$beforeEvaluate = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate === void 0 || _hooks$beforeEvaluate.call(hooks, node);
57
57
  currentNode = node;
58
- if (debug && (forceYield || node.type.endsWith("Statement") && node.type !== "TryStatement" && node.type !== "BlockStatement" && node.type !== "ForStatement" && node.type !== "ForInStatement" && node.type !== "ForOfStatement")) {
58
+ if (debug && (forceYield || node.type.endsWith("Statement") && !(node.type === "ExpressionStatement" && (node.expression.type === "CallExpression" || node.expression.type === "TaggedTemplateExpression")) && node.type !== "TryStatement" && node.type !== "BlockStatement" && node.type !== "DoWhileStatement" && node.type !== "WhileStatement" && node.type !== "ForStatement" && node.type !== "ForInStatement" && node.type !== "ForOfStatement")) {
59
59
  yield;
60
60
  }
61
61
  // Expressions:
@@ -583,7 +583,7 @@ export function cook(rootAst, codeSource) {
583
583
  let V;
584
584
  // eslint-disable-next-line no-constant-condition
585
585
  while (true) {
586
- const exprValue = GetValue(yield* Evaluate(node.test));
586
+ const exprValue = GetValue(yield* Evaluate(node.test, undefined, true));
587
587
  if (!exprValue) {
588
588
  return NormalCompletion(V);
589
589
  }
@@ -610,7 +610,7 @@ export function cook(rootAst, codeSource) {
610
610
  if (stmtResult.Value !== Empty) {
611
611
  V = stmtResult.Value;
612
612
  }
613
- const exprValue = GetValue(yield* Evaluate(node.test));
613
+ const exprValue = GetValue(yield* Evaluate(node.test, undefined, true));
614
614
  if (!exprValue) {
615
615
  return NormalCompletion(V);
616
616
  }
@@ -947,6 +947,7 @@ export function cook(rootAst, codeSource) {
947
947
 
948
948
  // https://tc39.es/ecma262/#sec-evaluate-property-access-with-identifier-key
949
949
  function EvaluatePropertyAccessWithIdentifierKey(baseValue, identifier, strict) {
950
+ currentNode = identifier;
950
951
  const propertyNameString = identifier.name;
951
952
  return new ReferenceRecord(baseValue, propertyNameString, strict);
952
953
  }