| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5825 ENTER_V8(isolate); | 5825 ENTER_V8(isolate); |
| 5826 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); | 5826 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); |
| 5827 has_pending_exception = result.is_null(); | 5827 has_pending_exception = result.is_null(); |
| 5828 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); | 5828 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); |
| 5829 return Utils::ToLocal(result); | 5829 return Utils::ToLocal(result); |
| 5830 } | 5830 } |
| 5831 | 5831 |
| 5832 | 5832 |
| 5833 bool Value::IsPromise() const { | 5833 bool Value::IsPromise() const { |
| 5834 i::Handle<i::Object> val = Utils::OpenHandle(this); | 5834 i::Handle<i::Object> val = Utils::OpenHandle(this); |
| 5835 if (!val->IsJSObject()) return false; | 5835 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; |
| 5836 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); | 5836 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); |
| 5837 i::Isolate* isolate = obj->GetIsolate(); | 5837 i::Isolate* isolate = obj->GetIsolate(); |
| 5838 LOG_API(isolate, "IsPromise"); | 5838 LOG_API(isolate, "IsPromise"); |
| 5839 ENTER_V8(isolate); | 5839 ENTER_V8(isolate); |
| 5840 EXCEPTION_PREAMBLE(isolate); | 5840 EXCEPTION_PREAMBLE(isolate); |
| 5841 i::Handle<i::Object> argv[] = { obj }; | 5841 i::Handle<i::Object> argv[] = { obj }; |
| 5842 i::Handle<i::Object> b = i::Execution::Call( | 5842 i::Handle<i::Object> b = i::Execution::Call( |
| 5843 isolate, | 5843 isolate, |
| 5844 handle( | 5844 handle( |
| 5845 isolate->context()->global_object()->native_context()->is_promise()), | 5845 isolate->context()->global_object()->native_context()->is_promise()), |
| (...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7635 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7635 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7636 Address callback_address = | 7636 Address callback_address = |
| 7637 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7637 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7638 VMState<EXTERNAL> state(isolate); | 7638 VMState<EXTERNAL> state(isolate); |
| 7639 ExternalCallbackScope call_scope(isolate, callback_address); | 7639 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7640 callback(info); | 7640 callback(info); |
| 7641 } | 7641 } |
| 7642 | 7642 |
| 7643 | 7643 |
| 7644 } } // namespace v8::internal | 7644 } } // namespace v8::internal |
| OLD | NEW |