| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return instanceTemplate->Clone(); | 145 return instanceTemplate->Clone(); |
| 146 } | 146 } |
| 147 return v8::Local<v8::Object>(); | 147 return v8::Local<v8::Object>(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(const Wrapp
erTypeInfo* type) | 150 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(const Wrapp
erTypeInfo* type) |
| 151 { | 151 { |
| 152 ASSERT(!m_errorPrototype.isEmpty()); | 152 ASSERT(!m_errorPrototype.isEmpty()); |
| 153 | 153 |
| 154 v8::Context::Scope scope(context()); | 154 v8::Context::Scope scope(context()); |
| 155 v8::Handle<v8::FunctionTemplate> functionTemplate = type->domTemplate(m_isol
ate, worldType(m_isolate)); | 155 v8::Handle<v8::FunctionTemplate> functionTemplate = type->domTemplate(m_isol
ate); |
| 156 // Getting the function might fail if we're running out of stack or memory. | 156 // Getting the function might fail if we're running out of stack or memory. |
| 157 v8::TryCatch tryCatch; | 157 v8::TryCatch tryCatch; |
| 158 v8::Local<v8::Function> function = functionTemplate->GetFunction(); | 158 v8::Local<v8::Function> function = functionTemplate->GetFunction(); |
| 159 if (function.IsEmpty()) | 159 if (function.IsEmpty()) |
| 160 return v8::Local<v8::Function>(); | 160 return v8::Local<v8::Function>(); |
| 161 | 161 |
| 162 if (type->parentClass) { | 162 if (type->parentClass) { |
| 163 v8::Local<v8::Object> prototypeTemplate = constructorForType(type->paren
tClass); | 163 v8::Local<v8::Object> prototypeTemplate = constructorForType(type->paren
tClass); |
| 164 if (prototypeTemplate.IsEmpty()) | 164 if (prototypeTemplate.IsEmpty()) |
| 165 return v8::Local<v8::Function>(); | 165 return v8::Local<v8::Function>(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (!data->IsString()) | 256 if (!data->IsString()) |
| 257 return -1; | 257 return -1; |
| 258 v8::String::Utf8Value utf8(data); | 258 v8::String::Utf8Value utf8(data); |
| 259 char* comma = strnstr(*utf8, ",", utf8.length()); | 259 char* comma = strnstr(*utf8, ",", utf8.length()); |
| 260 if (!comma) | 260 if (!comma) |
| 261 return -1; | 261 return -1; |
| 262 return atoi(comma + 1); | 262 return atoi(comma + 1); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace WebCore | 265 } // namespace WebCore |
| OLD | NEW |