| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 if (prototypeTemplate.IsEmpty()) | 107 if (prototypeTemplate.IsEmpty()) |
| 108 return v8::Local<v8::Function>(); | 108 return v8::Local<v8::Function>(); |
| 109 if (!v8CallBoolean(function->SetPrototype(currentContext, prototypeTempl
ate))) | 109 if (!v8CallBoolean(function->SetPrototype(currentContext, prototypeTempl
ate))) |
| 110 return v8::Local<v8::Function>(); | 110 return v8::Local<v8::Function>(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 v8::Local<v8::Object> prototypeObject = function->Get(currentContext, v8Atom
icString(m_isolate, "prototype")).ToLocalChecked().As<v8::Object>(); | 113 v8::Local<v8::Object> prototypeObject = function->Get(currentContext, v8Atom
icString(m_isolate, "prototype")).ToLocalChecked().As<v8::Object>(); |
| 114 if (prototypeObject->InternalFieldCount() == v8PrototypeInternalFieldcount | 114 if (prototypeObject->InternalFieldCount() == v8PrototypeInternalFieldcount |
| 115 && type->wrapperTypePrototype == WrapperTypeInfo::WrapperTypeObjectProto
type) | 115 && type->wrapperTypePrototype == WrapperTypeInfo::WrapperTypeObjectProto
type) |
| 116 prototypeObject->SetAlignedPointerInInternalField(v8PrototypeTypeIndex,
const_cast<WrapperTypeInfo*>(type)); | 116 prototypeObject->SetAlignedPointerInInternalField(v8PrototypeTypeIndex,
const_cast<WrapperTypeInfo*>(type)); |
| 117 type->installConditionallyEnabledMethods(prototypeObject, m_isolate); | 117 type->preparePrototypeObject(m_isolate, prototypeObject); |
| 118 if (type->wrapperTypePrototype == WrapperTypeInfo::WrapperTypeExceptionProto
type) { | 118 if (type->wrapperTypePrototype == WrapperTypeInfo::WrapperTypeExceptionProto
type) { |
| 119 if (!v8CallBoolean(prototypeObject->SetPrototype(currentContext, m_error
Prototype.newLocal(m_isolate)))) | 119 if (!v8CallBoolean(prototypeObject->SetPrototype(currentContext, m_error
Prototype.newLocal(m_isolate)))) |
| 120 return v8::Local<v8::Function>(); | 120 return v8::Local<v8::Function>(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 m_constructorMap.Set(type, function); | 123 m_constructorMap.Set(type, function); |
| 124 | 124 |
| 125 return function; | 125 return function; |
| 126 } | 126 } |
| 127 | 127 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 145 { | 145 { |
| 146 return m_compiledPrivateScript.Get(className); | 146 return m_compiledPrivateScript.Get(className); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void V8PerContextData::setCompiledPrivateScript(String className, v8::Handle<v8:
:Value> compiledObject) | 149 void V8PerContextData::setCompiledPrivateScript(String className, v8::Handle<v8:
:Value> compiledObject) |
| 150 { | 150 { |
| 151 m_compiledPrivateScript.Set(className, compiledObject); | 151 m_compiledPrivateScript.Set(className, compiledObject); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| OLD | NEW |