| Index: Source/bindings/core/v8/PrivateScriptRunner.cpp
|
| diff --git a/Source/bindings/core/v8/PrivateScriptRunner.cpp b/Source/bindings/core/v8/PrivateScriptRunner.cpp
|
| index 491578038954b98bb5ccf68ea57d0f01cf68c269..fabaec56be687e628ee5be08631f8e6f5780b92c 100644
|
| --- a/Source/bindings/core/v8/PrivateScriptRunner.cpp
|
| +++ b/Source/bindings/core/v8/PrivateScriptRunner.cpp
|
| @@ -98,6 +98,15 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Handle<v8::Ob
|
| RELEASE_ASSERT_NOT_REACHED();
|
| }
|
| }
|
| +
|
| + // Inject the prototype object of the private script into the prototype chain of the holder object.
|
| + // This is necessary to let the holder object use properties defined on the prototype object
|
| + // of the private script. (e.g., if the prototype object has |foo|, the holder object should be able
|
| + // to use it with |this.foo|.)
|
| + if (classObject->GetPrototype() != holderObject->GetPrototype())
|
| + classObject->SetPrototype(holderObject->GetPrototype());
|
| + holderObject->SetPrototype(classObject);
|
| +
|
| isInitialized = v8Boolean(true, isolate);
|
| V8HiddenValue::setHiddenValue(isolate, holderObject, V8HiddenValue::privateScriptObjectIsInitialized(isolate), isInitialized);
|
| }
|
|
|