summaryrefslogtreecommitdiff
path: root/chromium/v8/src/runtime/runtime-error.cc
blob: 7cd98f223b90cbb462f7bbe46a75ea59cf8d3ba9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/runtime/runtime-utils.h"

#include "src/arguments.h"
#include "src/base/platform/time.h"
#include "src/conversions-inl.h"
#include "src/futex-emulation.h"
#include "src/globals.h"

namespace v8 {
namespace internal {

RUNTIME_FUNCTION(Runtime_ErrorToString) {
  HandleScope scope(isolate);
  DCHECK_EQ(1, args.length());
  CONVERT_ARG_HANDLE_CHECKED(Object, recv, 0);
  RETURN_RESULT_OR_FAILURE(isolate, ErrorUtils::ToString(isolate, recv));
}

RUNTIME_FUNCTION(Runtime_IsJSError) {
  SealHandleScope shs(isolate);
  DCHECK_EQ(1, args.length());
  return isolate->heap()->ToBoolean(args[0]->IsJSError());
}

}  // namespace internal
}  // namespace v8