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 5804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5815 ENTER_V8(isolate); | 5815 ENTER_V8(isolate); |
5816 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); | 5816 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); |
5817 has_pending_exception = result.is_null(); | 5817 has_pending_exception = result.is_null(); |
5818 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); | 5818 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); |
5819 return Utils::ToLocal(result); | 5819 return Utils::ToLocal(result); |
5820 } | 5820 } |
5821 | 5821 |
5822 | 5822 |
5823 bool Value::IsPromise() const { | 5823 bool Value::IsPromise() const { |
5824 i::Handle<i::Object> val = Utils::OpenHandle(this); | 5824 i::Handle<i::Object> val = Utils::OpenHandle(this); |
5825 if (!val->IsJSObject()) return false; | 5825 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; |
5826 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); | 5826 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); |
5827 i::Isolate* isolate = obj->GetIsolate(); | 5827 i::Isolate* isolate = obj->GetIsolate(); |
5828 LOG_API(isolate, "IsPromise"); | 5828 LOG_API(isolate, "IsPromise"); |
5829 ENTER_V8(isolate); | 5829 ENTER_V8(isolate); |
5830 EXCEPTION_PREAMBLE(isolate); | 5830 EXCEPTION_PREAMBLE(isolate); |
5831 i::Handle<i::Object> argv[] = { obj }; | 5831 i::Handle<i::Object> argv[] = { obj }; |
5832 i::Handle<i::Object> b = i::Execution::Call( | 5832 i::Handle<i::Object> b = i::Execution::Call( |
5833 isolate, | 5833 isolate, |
5834 handle( | 5834 handle( |
5835 isolate->context()->global_object()->native_context()->is_promise()), | 5835 isolate->context()->global_object()->native_context()->is_promise()), |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7625 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7625 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7626 Address callback_address = | 7626 Address callback_address = |
7627 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7627 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7628 VMState<EXTERNAL> state(isolate); | 7628 VMState<EXTERNAL> state(isolate); |
7629 ExternalCallbackScope call_scope(isolate, callback_address); | 7629 ExternalCallbackScope call_scope(isolate, callback_address); |
7630 callback(info); | 7630 callback(info); |
7631 } | 7631 } |
7632 | 7632 |
7633 | 7633 |
7634 } } // namespace v8::internal | 7634 } } // namespace v8::internal |
OLD | NEW |