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-utils.h"
6 : #include "src/builtins/builtins.h"
7 : #include "src/objects-inl.h"
8 :
9 : namespace v8 {
10 : namespace internal {
11 :
12 285 : BUILTIN(IsPromise) {
13 : SealHandleScope scope(isolate);
14 :
15 : Handle<Object> object = args.atOrUndefined(isolate, 1);
16 95 : return isolate->heap()->ToBoolean(object->IsJSPromise());
17 : }
18 :
19 : } // namespace internal
20 : } // namespace v8
|