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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2860913002: [ES6 modules] accessing document.currentScript on module scripts should not crash (Closed)
Patch Set: remove bad title Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 9c73cbac6ab4afb45ac886dc77914bf1bbfdf3e8..fceb6652aed8561eb7a9b867e323fd0799e1c87a 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5289,8 +5289,10 @@ KURL Document::OpenSearchDescriptionURL() {
void Document::currentScriptForBinding(
HTMLScriptElementOrSVGScriptElement& script_element) const {
- if (!current_script_stack_.IsEmpty())
- current_script_stack_.back()->SetScriptElementForBinding(script_element);
+ if (!current_script_stack_.IsEmpty()) {
+ if (ScriptElementBase* script_element_base = current_script_stack_.back())
+ script_element_base->SetScriptElementForBinding(script_element);
+ }
}
void Document::PushCurrentScript(ScriptElementBase* new_current_script) {
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/set-currentScript-on-window.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698