| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 Isolate* isolate = CcTest::i_isolate(); | 54 Isolate* isolate = CcTest::i_isolate(); |
| 55 Factory* factory = isolate->factory(); | 55 Factory* factory = isolate->factory(); |
| 56 | 56 |
| 57 Handle<String> str_name = factory->InternalizeUtf8String(name); | 57 Handle<String> str_name = factory->InternalizeUtf8String(name); |
| 58 Handle<ScriptContextTable> script_contexts( | 58 Handle<ScriptContextTable> script_contexts( |
| 59 isolate->native_context()->script_context_table()); | 59 isolate->native_context()->script_context_table()); |
| 60 | 60 |
| 61 ScriptContextTable::LookupResult lookup_result; | 61 ScriptContextTable::LookupResult lookup_result; |
| 62 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { | 62 if (ScriptContextTable::Lookup(script_contexts, str_name, &lookup_result)) { |
| 63 Handle<Object> result = | 63 Handle<Object> result = |
| 64 FixedArray::get(ScriptContextTable::GetContext( | 64 FixedArray::get(*ScriptContextTable::GetContext( |
| 65 script_contexts, lookup_result.context_index), | 65 script_contexts, lookup_result.context_index), |
| 66 lookup_result.slot_index); | 66 lookup_result.slot_index, isolate); |
| 67 return Handle<T>::cast(result); | 67 return Handle<T>::cast(result); |
| 68 } | 68 } |
| 69 return Handle<T>(); | 69 return Handle<T>(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 template <typename T = Object> | 73 template <typename T = Object> |
| 74 Handle<T> GetLexical(const std::string& name) { | 74 Handle<T> GetLexical(const std::string& name) { |
| 75 return GetLexical<T>(name.c_str()); | 75 return GetLexical<T>(name.c_str()); |
| 76 } | 76 } |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 TestSubclassBuiltin("A1", JS_PROMISE_TYPE, "Promise", | 1102 TestSubclassBuiltin("A1", JS_PROMISE_TYPE, "Promise", |
| 1103 "function(resolve, reject) { resolve('ok'); }", | 1103 "function(resolve, reject) { resolve('ok'); }", |
| 1104 first_field); | 1104 first_field); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 | 1107 |
| 1108 TEST(SubclassPromiseBuiltinNoInlineNew) { | 1108 TEST(SubclassPromiseBuiltinNoInlineNew) { |
| 1109 FLAG_inline_new = false; | 1109 FLAG_inline_new = false; |
| 1110 TestSubclassPromiseBuiltin(); | 1110 TestSubclassPromiseBuiltin(); |
| 1111 } | 1111 } |
| OLD | NEW |