| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return v8::Local<v8::Function>(); | 121 return v8::Local<v8::Function>(); |
| 122 function->SetPrototype(proto); | 122 function->SetPrototype(proto); |
| 123 } | 123 } |
| 124 | 124 |
| 125 v8::Local<v8::Value> prototypeValue = function->Get(v8::String::NewSymbol("p
rototype")); | 125 v8::Local<v8::Value> prototypeValue = function->Get(v8::String::NewSymbol("p
rototype")); |
| 126 if (!prototypeValue.IsEmpty() && prototypeValue->IsObject()) { | 126 if (!prototypeValue.IsEmpty() && prototypeValue->IsObject()) { |
| 127 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(prot
otypeValue); | 127 v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(prot
otypeValue); |
| 128 if (prototypeObject->InternalFieldCount() == v8PrototypeInternalFieldcou
nt | 128 if (prototypeObject->InternalFieldCount() == v8PrototypeInternalFieldcou
nt |
| 129 && type->wrapperTypePrototype == WrapperTypeObjectPrototype) | 129 && type->wrapperTypePrototype == WrapperTypeObjectPrototype) |
| 130 prototypeObject->SetAlignedPointerInInternalField(v8PrototypeTypeInd
ex, type); | 130 prototypeObject->SetAlignedPointerInInternalField(v8PrototypeTypeInd
ex, type); |
| 131 type->installPerContextPrototypeProperties(prototypeObject, m_isolate); | 131 type->installPerContextEnabledPrototypeProperties(prototypeObject, m_iso
late); |
| 132 if (type->wrapperTypePrototype == WrapperTypeErrorPrototype) | 132 if (type->wrapperTypePrototype == WrapperTypeErrorPrototype) |
| 133 prototypeObject->SetPrototype(m_errorPrototype.newLocal(m_isolate)); | 133 prototypeObject->SetPrototype(m_errorPrototype.newLocal(m_isolate)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 m_constructorMap.set(type, UnsafePersistent<v8::Function>(m_isolate, functio
n)); | 136 m_constructorMap.set(type, UnsafePersistent<v8::Function>(m_isolate, functio
n)); |
| 137 | 137 |
| 138 return function; | 138 return function; |
| 139 } | 139 } |
| 140 | 140 |
| 141 v8::Local<v8::Object> V8PerContextData::prototypeForType(WrapperTypeInfo* type) | 141 v8::Local<v8::Object> V8PerContextData::prototypeForType(WrapperTypeInfo* type) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (!data->IsString()) | 212 if (!data->IsString()) |
| 213 return -1; | 213 return -1; |
| 214 v8::String::AsciiValue ascii(data); | 214 v8::String::AsciiValue ascii(data); |
| 215 char* comma = strnstr(*ascii, ",", ascii.length()); | 215 char* comma = strnstr(*ascii, ",", ascii.length()); |
| 216 if (!comma) | 216 if (!comma) |
| 217 return -1; | 217 return -1; |
| 218 return atoi(comma + 1); | 218 return atoi(comma + 1); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace WebCore | 221 } // namespace WebCore |
| OLD | NEW |