Line data Source code
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/objects-inl.h"
11 :
12 : namespace v8 {
13 : namespace internal {
14 :
15 40 : BUILTIN(IsPromise) {
16 : SealHandleScope scope(isolate);
17 :
18 : Handle<Object> object = args.atOrUndefined(isolate, 1);
19 20 : return isolate->heap()->ToBoolean(object->IsJSPromise());
20 : }
21 :
22 : } // namespace internal
23 183867 : } // namespace v8
|