| Index: Source/bindings/templates/methods.cpp
|
| diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
|
| index b4915e5797726c4a1550bdd833262039af5a135d..a4e8b540fff92390e27aff9b3d2591d926c17896 100644
|
| --- a/Source/bindings/templates/methods.cpp
|
| +++ b/Source/bindings/templates/methods.cpp
|
| @@ -496,9 +496,6 @@ static void constructor{{constructor.overload_index}}(const v8::FunctionCallback
|
| {% if is_constructor_call_with_execution_context %}
|
| ExecutionContext* executionContext = currentExecutionContext(isolate);
|
| {% endif %}
|
| - {% if is_constructor_call_with_document %}
|
| - Document& document = *toDocument(currentExecutionContext(isolate));
|
| - {% endif %}
|
| {{constructor.cpp_type}} impl = {{constructor.cpp_value}};
|
| {% if is_constructor_raises_exception %}
|
| if (exceptionState.throwIfNeeded())
|
| @@ -540,9 +537,10 @@ static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V
|
| return;
|
| }
|
|
|
| - Document* documentPtr = currentDOMWindow(isolate)->document();
|
| + ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
|
| +
|
| + Document* documentPtr = toDocument(executionContext);
|
| 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.
|
|
|