| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 { | 50 { |
| 51 m_contextHolder->SetContext(context); | 51 m_contextHolder->SetContext(context); |
| 52 | 52 |
| 53 v8::Context::Scope contextScope(context); | 53 v8::Context::Scope contextScope(context); |
| 54 ASSERT(m_errorPrototype.isEmpty()); | 54 ASSERT(m_errorPrototype.isEmpty()); |
| 55 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global
()->Get(v8AtomicString(m_isolate, "Error"))); | 55 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(context->Global
()->Get(v8AtomicString(m_isolate, "Error"))); |
| 56 ASSERT(!object.IsEmpty()); | 56 ASSERT(!object.IsEmpty()); |
| 57 v8::Handle<v8::Value> prototypeValue = object->Get(v8AtomicString(m_isolate,
"prototype")); | 57 v8::Handle<v8::Value> prototypeValue = object->Get(v8AtomicString(m_isolate,
"prototype")); |
| 58 ASSERT(!prototypeValue.IsEmpty()); | 58 ASSERT(!prototypeValue.IsEmpty()); |
| 59 m_errorPrototype.set(m_isolate, prototypeValue); | 59 m_errorPrototype.set(m_isolate, prototypeValue); |
| 60 | |
| 61 m_functionConstructor.set(m_isolate, v8::Handle<v8::Function>::Cast(context-
>Global()->Get(v8AtomicString(m_isolate, "Function")))); | |
| 62 } | 60 } |
| 63 | 61 |
| 64 V8PerContextData::~V8PerContextData() | 62 V8PerContextData::~V8PerContextData() |
| 65 { | 63 { |
| 66 } | 64 } |
| 67 | 65 |
| 68 PassOwnPtr<V8PerContextData> V8PerContextData::create(v8::Handle<v8::Context> co
ntext) | 66 PassOwnPtr<V8PerContextData> V8PerContextData::create(v8::Handle<v8::Context> co
ntext) |
| 69 { | 67 { |
| 70 return adoptPtr(new V8PerContextData(context)); | 68 return adoptPtr(new V8PerContextData(context)); |
| 71 } | 69 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (!data->IsString()) | 196 if (!data->IsString()) |
| 199 return -1; | 197 return -1; |
| 200 v8::String::Utf8Value utf8(data); | 198 v8::String::Utf8Value utf8(data); |
| 201 char* comma = strnstr(*utf8, ",", utf8.length()); | 199 char* comma = strnstr(*utf8, ",", utf8.length()); |
| 202 if (!comma) | 200 if (!comma) |
| 203 return -1; | 201 return -1; |
| 204 return atoi(comma + 1); | 202 return atoi(comma + 1); |
| 205 } | 203 } |
| 206 | 204 |
| 207 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |