@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/cjs/cook.js CHANGED
@@ -60,7 +60,7 @@ function cook(rootAst, codeSource, {
60
60
  var _hooks$beforeEvaluate, _hooks$beforeBranch2;
61
61
  (_hooks$beforeEvaluate = hooks.beforeEvaluate) === null || _hooks$beforeEvaluate === void 0 || _hooks$beforeEvaluate.call(hooks, node);
62
62
  currentNode = node;
63
- if (debug && (forceYield || node.type.endsWith("Statement") && node.type !== "TryStatement" && node.type !== "BlockStatement" && node.type !== "ForStatement" && node.type !== "ForInStatement" && node.type !== "ForOfStatement")) {
63
+ 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")) {
64
64
  yield;
65
65
  }
66
66
  // Expressions:
@@ -588,7 +588,7 @@ function cook(rootAst, codeSource, {
588
588
  let V;
589
589
  // eslint-disable-next-line no-constant-condition
590
590
  while (true) {
591
- const exprValue = (0, _contextFree.GetValue)(yield* Evaluate(node.test));
591
+ const exprValue = (0, _contextFree.GetValue)(yield* Evaluate(node.test, undefined, true));
592
592
  if (!exprValue) {
593
593
  return (0, _ExecutionContext.NormalCompletion)(V);
594
594
  }
@@ -615,7 +615,7 @@ function cook(rootAst, codeSource, {
615
615
  if (stmtResult.Value !== _ExecutionContext.Empty) {
616
616
  V = stmtResult.Value;
617
617
  }
618
- const exprValue = (0, _contextFree.GetValue)(yield* Evaluate(node.test));
618
+ const exprValue = (0, _contextFree.GetValue)(yield* Evaluate(node.test, undefined, true));
619
619
  if (!exprValue) {
620
620
  return (0, _ExecutionContext.NormalCompletion)(V);
621
621
  }
@@ -952,6 +952,7 @@ function cook(rootAst, codeSource, {
952
952
 
953
953
  // https://tc39.es/ecma262/#sec-evaluate-property-access-with-identifier-key
954
954
  function EvaluatePropertyAccessWithIdentifierKey(baseValue, identifier, strict) {
955
+ currentNode = identifier;
955
956
  const propertyNameString = identifier.name;
956
957
  return new _ExecutionContext.ReferenceRecord(baseValue, propertyNameString, strict);
957
958
  }