JSC incorrectly interpreting script, sets Global Property instead of Global Lexical...
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 10:18:28 +0000 (10:18 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2018 10:18:28 +0000 (10:18 +0000)
commitb049308dc96af607de228bedafe8ce6ad370832e
treea91f2eeb3e67c5a36f71cac5281255eb845442c8
parent88f2843d563bb876155d9e87b1b9fa4179975d72
JSC incorrectly interpreting script, sets Global Property instead of Global Lexical variable (LiteralParser / JSONP path)
https://bugs.webkit.org/show_bug.cgi?id=182074
<rdar://problem/36846261>

Reviewed by Mark Lam.

JSTests:

* stress/jsonp-program-evaluate-path-must-consider-global-lexical-environment.js: Added.
(assert):
(let.func):
(let.o.foo):
(varFunc):

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt:

Source/JavaScriptCore:

This patch teaches the JSONP evaluator about the global lexical environment.
Before, it was using the global object as the global scope, but that's wrong.
The global lexical environment is the first node in the global scope chain.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeProgram):
* jsc.cpp:
(GlobalObject::finishCreation):
(shellSupportsRichSourceInfo):
(functionDisableRichSourceInfo):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::tryJSONPParse):
* runtime/LiteralParser.h:

LayoutTests:

* http/tests/security/regress-52192-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/jsonp-program-evaluate-path-must-consider-global-lexical-environment.js [new file with mode: 0644]
LayoutTests/ChangeLog
LayoutTests/http/tests/security/regress-52192-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/LiteralParser.cpp
Source/JavaScriptCore/runtime/LiteralParser.h