1 | // Copyright 2017 the V8 project authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #include "src/builtins/builtins-promise.h" |
6 | |
7 | #include "src/builtins/builtins-utils-inl.h" |
8 | #include "src/builtins/builtins.h" |
9 | #include "src/counters.h" |
10 | #include "src/heap/heap-inl.h" // For ToBoolean. TODO(jkummerow): Drop. |
11 | #include "src/objects-inl.h" |
12 | |
13 | namespace v8 { |
14 | namespace internal { |
15 | |
16 | BUILTIN(IsPromise) { |
17 | SealHandleScope scope(isolate); |
18 | |
19 | Handle<Object> object = args.atOrUndefined(isolate, 1); |
20 | return isolate->heap()->ToBoolean(object->IsJSPromise()); |
21 | } |
22 | |
23 | } // namespace internal |
24 | } // namespace v8 |
25 |