| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return v8::Local<v8::Object>(); | 88 return v8::Local<v8::Object>(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(const Wrapp
erTypeInfo* type) | 91 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(const Wrapp
erTypeInfo* type) |
| 92 { | 92 { |
| 93 ASSERT(!m_errorPrototype.isEmpty()); | 93 ASSERT(!m_errorPrototype.isEmpty()); |
| 94 | 94 |
| 95 v8::Context::Scope scope(context()); | 95 v8::Context::Scope scope(context()); |
| 96 v8::Handle<v8::FunctionTemplate> functionTemplate = type->domTemplate(m_isol
ate); | 96 v8::Handle<v8::FunctionTemplate> functionTemplate = type->domTemplate(m_isol
ate); |
| 97 // Getting the function might fail if we're running out of stack or memory. | 97 // Getting the function might fail if we're running out of stack or memory. |
| 98 v8::TryCatch tryCatch; | |
| 99 v8::Local<v8::Function> function = functionTemplate->GetFunction(); | 98 v8::Local<v8::Function> function = functionTemplate->GetFunction(); |
| 100 if (function.IsEmpty()) | 99 if (function.IsEmpty()) |
| 101 return v8::Local<v8::Function>(); | 100 return v8::Local<v8::Function>(); |
| 102 | 101 |
| 103 if (type->parentClass) { | 102 if (type->parentClass) { |
| 104 v8::Local<v8::Object> prototypeTemplate = constructorForType(type->paren
tClass); | 103 v8::Local<v8::Object> prototypeTemplate = constructorForType(type->paren
tClass); |
| 105 if (prototypeTemplate.IsEmpty()) | 104 if (prototypeTemplate.IsEmpty()) |
| 106 return v8::Local<v8::Function>(); | 105 return v8::Local<v8::Function>(); |
| 107 function->SetPrototype(prototypeTemplate); | 106 function->SetPrototype(prototypeTemplate); |
| 108 } | 107 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 { | 151 { |
| 153 return m_compiledPrivateScript.Get(className); | 152 return m_compiledPrivateScript.Get(className); |
| 154 } | 153 } |
| 155 | 154 |
| 156 void V8PerContextData::setCompiledPrivateScript(String className, v8::Handle<v8:
:Value> compiledObject) | 155 void V8PerContextData::setCompiledPrivateScript(String className, v8::Handle<v8:
:Value> compiledObject) |
| 157 { | 156 { |
| 158 m_compiledPrivateScript.Set(className, compiledObject); | 157 m_compiledPrivateScript.Set(className, compiledObject); |
| 159 } | 158 } |
| 160 | 159 |
| 161 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |