OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug.h" | 9 #include "src/debug.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { | 73 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { |
74 DCHECK(args.length() == 3); | 74 DCHECK(args.length() == 3); |
75 HandleScope scope(isolate); | 75 HandleScope scope(isolate); |
76 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 76 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
77 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 77 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
78 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); | 78 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); |
79 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); | 79 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); |
80 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); | 80 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
81 // Do not report if we actually have a handler. | 81 // Do not report if we actually have a handler. |
82 if (JSReceiver::GetDataProperty(promise, key)->IsUndefined()) { | 82 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { |
83 isolate->ReportPromiseReject(promise, value, | 83 isolate->ReportPromiseReject(promise, value, |
84 v8::kPromiseRejectWithNoHandler); | 84 v8::kPromiseRejectWithNoHandler); |
85 } | 85 } |
86 return isolate->heap()->undefined_value(); | 86 return isolate->heap()->undefined_value(); |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) { | 90 RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) { |
91 DCHECK(args.length() == 1); | 91 DCHECK(args.length() == 1); |
92 HandleScope scope(isolate); | 92 HandleScope scope(isolate); |
93 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 93 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
94 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); | 94 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
95 // At this point, no revocation has been issued before | 95 // At this point, no revocation has been issued before |
96 RUNTIME_ASSERT(JSReceiver::GetDataProperty(promise, key)->IsUndefined()); | 96 RUNTIME_ASSERT(JSObject::GetDataProperty(promise, key)->IsUndefined()); |
97 isolate->ReportPromiseReject(promise, Handle<Object>(), | 97 isolate->ReportPromiseReject(promise, Handle<Object>(), |
98 v8::kPromiseHandlerAddedAfterReject); | 98 v8::kPromiseHandlerAddedAfterReject); |
99 return isolate->heap()->undefined_value(); | 99 return isolate->heap()->undefined_value(); |
100 } | 100 } |
101 | 101 |
102 | 102 |
103 RUNTIME_FUNCTION(Runtime_PromiseHasHandlerSymbol) { | 103 RUNTIME_FUNCTION(Runtime_PromiseHasHandlerSymbol) { |
104 DCHECK(args.length() == 0); | 104 DCHECK(args.length() == 0); |
105 return isolate->heap()->promise_has_handler_symbol(); | 105 return isolate->heap()->promise_has_handler_symbol(); |
106 } | 106 } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return args[0]; | 403 return args[0]; |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 RUNTIME_FUNCTION(Runtime_HarmonyToString) { | 407 RUNTIME_FUNCTION(Runtime_HarmonyToString) { |
408 // TODO(caitp): Delete this runtime method when removing --harmony-tostring | 408 // TODO(caitp): Delete this runtime method when removing --harmony-tostring |
409 return isolate->heap()->ToBoolean(FLAG_harmony_tostring); | 409 return isolate->heap()->ToBoolean(FLAG_harmony_tostring); |
410 } | 410 } |
411 } | 411 } |
412 } // namespace v8::internal | 412 } // namespace v8::internal |
OLD | NEW |