@next-core/cook 2.5.2 → 2.5.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.
package/dist/esm/cook.js CHANGED
@@ -166,7 +166,7 @@ export function cook(rootAst, codeSource) {
166
166
  case "||":
167
167
  return NormalCompletion(leftValue || GetValue(yield* Evaluate(node.right)));
168
168
  case "??":
169
- return NormalCompletion(leftValue ?? GetValue(yield* Evaluate(node.right)));
169
+ return NormalCompletion(leftValue !== null && leftValue !== void 0 ? leftValue : GetValue(yield* Evaluate(node.right)));
170
170
  // istanbul ignore next
171
171
  default:
172
172
  throw new SyntaxError(
@@ -1318,7 +1318,7 @@ export function cook(rootAst, codeSource) {
1318
1318
  return closure;
1319
1319
  } else {
1320
1320
  const closure = OrdinaryFunctionCreate(functionExpression, scope, true, false);
1321
- SetFunctionName(closure, name ?? "");
1321
+ SetFunctionName(closure, name !== null && name !== void 0 ? name : "");
1322
1322
  return closure;
1323
1323
  }
1324
1324
  }
@@ -1327,7 +1327,7 @@ export function cook(rootAst, codeSource) {
1327
1327
  function InstantiateArrowFunctionExpression(arrowFunction, name) {
1328
1328
  const scope = getRunningContext().LexicalEnvironment;
1329
1329
  const closure = OrdinaryFunctionCreate(arrowFunction, scope, false, true);
1330
- SetFunctionName(closure, name ?? "");
1330
+ SetFunctionName(closure, name !== null && name !== void 0 ? name : "");
1331
1331
  return closure;
1332
1332
  }
1333
1333
  function SetFunctionName(F, name) {