setTimeout / setInterval's string execution should inherit SourceOrigin correctly
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jan 2017 00:49:01 +0000 (00:49 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jan 2017 00:49:01 +0000 (00:49 +0000)
commitb007a481904f19292941d833781db8892be557cf
tree414cce4a7d621a9a553210910a2e4996f71b42d7
parent6a8b732277df367d6f15c0848aa5cfa2978938a4
setTimeout / setInterval's string execution should inherit SourceOrigin correctly
https://bugs.webkit.org/show_bug.cgi?id=167097

Reviewed by Darin Adler.

Source/WebCore:

Tests: js/dom/modules/import-from-set-interval.html
       js/dom/modules/import-from-set-timeout.html

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):

LayoutTests:

We set the default SourceOrigin for the ScriptController::executeScriptInWorld.
The default SourceOrigin has the document baseURL and CachedScriptFetcher.

setTimeout and setInterval use this interface. And it uses the default SourceOrigin
for the document (Realm of the setTimeout / setInterval). This is the expected
behavior in the dynamic import proposal.

* js/dom/modules/import-from-set-interval-expected.txt: Added.
* js/dom/modules/import-from-set-interval.html: Added.
* js/dom/modules/import-from-set-timeout-expected.txt: Added.
* js/dom/modules/import-from-set-timeout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/dom/modules/import-from-set-interval-expected.txt [new file with mode: 0644]
LayoutTests/js/dom/modules/import-from-set-interval.html [new file with mode: 0644]
LayoutTests/js/dom/modules/import-from-set-timeout-expected.txt [new file with mode: 0644]
LayoutTests/js/dom/modules/import-from-set-timeout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptController.cpp