* Fixes #3161

* Fix the error message

* woops

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-06-02 04:01:25 -07:00
committed by GitHub
parent 4c6245b2e5
commit 97c522517c
3 changed files with 16 additions and 5 deletions

View File

@@ -391,8 +391,12 @@ JSC::SourceCode createCommonJSModule(
// to pass to that and it isn't used directly much, so that
// seems harder to do correctly.
{
globalObject->clearGlobalScopeExtension();
JSWithScope* withScope = JSWithScope::create(vm, globalObject, globalObject->globalScope(), scopeExtensionObject);
vm.interpreter.executeEval(executable, globalObject, withScope);
globalObject->setGlobalScopeExtension(withScope);
vm.interpreter.executeEval(executable, globalObject, globalObject->globalScope());
globalObject->clearGlobalScopeExtension();
if (UNLIKELY(catchScope.exception())) {
auto returnedException = catchScope.exception();