Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index 4a44e7228dc0ce23b2376546459023e7542a645f..7bb209af1074f3b4fa321c5e2b62b7ef9585b270 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -540,13 +540,7 @@ static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V |
return; |
} |
- Document* documentPtr = currentDOMWindow(isolate)->document(); |
- ASSERT(documentPtr); |
- Document& document = *documentPtr; |
- |
- // Make sure the document is added to the DOM Node map. Otherwise, the {{cpp_class}} instance |
- // may end up being the only node in the map and get garbage-collected prematurely. |
- toV8(documentPtr, info.Holder(), isolate); |
+ Document& document = *toDocument(currentExecutionContext(isolate)); |
{% if constructor.has_exception_state %} |
ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interface_name}}", info.Holder(), isolate); |