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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) |
142 { | 142 { |
143 return constructorForType(type)->Get(v8String("prototype", m_isolate)).As<v8
::Object>(); | 143 v8::Local<v8::Object> constructor = constructorForType(type); |
| 144 if (constructor.IsEmpty()) |
| 145 return v8::Local<v8::Object>(); |
| 146 return constructor->Get(v8String("prototype", m_isolate)).As<v8::Object>(); |
144 } | 147 } |
145 | 148 |
146 void V8PerContextData::addCustomElementBinding(CustomElementDefinition* definiti
on, PassOwnPtr<CustomElementBinding> binding) | 149 void V8PerContextData::addCustomElementBinding(CustomElementDefinition* definiti
on, PassOwnPtr<CustomElementBinding> binding) |
147 { | 150 { |
148 ASSERT(!m_customElementBindings->contains(definition)); | 151 ASSERT(!m_customElementBindings->contains(definition)); |
149 m_customElementBindings->add(definition, binding); | 152 m_customElementBindings->add(definition, binding); |
150 } | 153 } |
151 | 154 |
152 void V8PerContextData::clearCustomElementBinding(CustomElementDefinition* defini
tion) | 155 void V8PerContextData::clearCustomElementBinding(CustomElementDefinition* defini
tion) |
153 { | 156 { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (!data->IsString()) | 212 if (!data->IsString()) |
210 return -1; | 213 return -1; |
211 v8::String::AsciiValue ascii(data); | 214 v8::String::AsciiValue ascii(data); |
212 char* comma = strnstr(*ascii, ",", ascii.length()); | 215 char* comma = strnstr(*ascii, ",", ascii.length()); |
213 if (!comma) | 216 if (!comma) |
214 return -1; | 217 return -1; |
215 return atoi(comma + 1); | 218 return atoi(comma + 1); |
216 } | 219 } |
217 | 220 |
218 } // namespace WebCore | 221 } // namespace WebCore |
OLD | NEW |