Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Issue 2860913002: [ES6 modules] accessing document.currentScript on module scripts should not crash (Closed)

Created:
3 years, 7 months ago by kouhei (in TOK)
Modified:
3 years, 7 months ago
Reviewers:
Nate Chapin, hiroshige, module-dev, adamk, haraken, domenic
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-w3ctests_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[ES6 modules] accessing document.currentScript on module scripts should not crash Before this CL, accessing document.currentScript caused crash. It dereferenced nullptr pushed to Document::current_script_stack_ by ScriptLoader::DoExecuteScript() for script == ScriptType::kModule. This CL adds null check in Document::currentScriptForBinding so that it is aware that the item on the stack may be nullptr. TEST=wpt/html/semantics/scripting-1/the-script-element/module/currentScript-null.html BUG=716951 Review-Url: https://codereview.chromium.org/2860913002 Cr-Commit-Position: refs/heads/master@{#469435} Committed: https://chromium.googlesource.com/chromium/src/+/3d379f511131f8692bc7f46e617794d685935a0b

Patch Set 1 #

Patch Set 2 : domenic #

Total comments: 1

Patch Set 3 : remove bad title #

Messages

Total messages: 23 (12 generated)
kouhei (in TOK)
3 years, 7 months ago (2017-05-04 01:34:47 UTC) #2
kouhei (in TOK)
+haraken as I saw him online
3 years, 7 months ago (2017-05-04 02:10:47 UTC) #6
domenic
It would be good to add a test that it's also null when no import ...
3 years, 7 months ago (2017-05-04 02:32:54 UTC) #7
haraken
LGTM with domenic's comment addressed.
3 years, 7 months ago (2017-05-04 14:43:00 UTC) #10
kouhei (in TOK)
On 2017/05/04 02:32:54, domenic wrote: > It would be good to add a test that ...
3 years, 7 months ago (2017-05-04 15:09:53 UTC) #11
domenic
lgtm https://codereview.chromium.org/2860913002/diff/20001/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/currentScript-null.html File third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/currentScript-null.html (right): https://codereview.chromium.org/2860913002/diff/20001/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/currentScript-null.html#newcode2 third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/currentScript-null.html:2: <title>html-script-module-crossOrigin</title> Nit: title is not correct. Can just ...
3 years, 7 months ago (2017-05-04 15:13:00 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860913002/40001
3 years, 7 months ago (2017-05-04 16:32:48 UTC) #15
hiroshige
Filename format looks inconsistent: currentscript.js (all lowercase letters) currentScript-null.html (with a uppercase letter)
3 years, 7 months ago (2017-05-04 16:41:56 UTC) #16
hiroshige
On 2017/05/04 16:41:56, hiroshige wrote: > Filename format looks inconsistent: > currentscript.js (all lowercase letters) ...
3 years, 7 months ago (2017-05-04 18:59:16 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860913002/40001
3 years, 7 months ago (2017-05-04 18:59:23 UTC) #20
commit-bot: I haz the power
3 years, 7 months ago (2017-05-04 19:54:08 UTC) #23
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/3d379f511131f8692bc7f46e6177...

Powered by Google App Engine
This is Rietveld 408576698