diff options
Diffstat (limited to 'deps/v8/src/builtins/builtins-error.cc')
-rw-r--r-- | deps/v8/src/builtins/builtins-error.cc | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/deps/v8/src/builtins/builtins-error.cc b/deps/v8/src/builtins/builtins-error.cc index 3634362205c..840298eacbf 100644 --- a/deps/v8/src/builtins/builtins-error.cc +++ b/deps/v8/src/builtins/builtins-error.cc @@ -18,24 +18,9 @@ namespace internal { // ES6 section 19.5.1.1 Error ( message ) BUILTIN(ErrorConstructor) { HandleScope scope(isolate); - - FrameSkipMode mode = SKIP_FIRST; - Handle<Object> caller; - - // When we're passed a JSFunction as new target, we can skip frames until that - // specific function is seen instead of unconditionally skipping the first - // frame. - if (args.new_target()->IsJSFunction()) { - mode = SKIP_UNTIL_SEEN; - caller = args.new_target(); - } - RETURN_RESULT_OR_FAILURE( - isolate, - ErrorUtils::Construct(isolate, args.target(), - Handle<Object>::cast(args.new_target()), - args.atOrUndefined(isolate, 1), mode, caller, - ErrorUtils::StackTraceCollection::kDetailed)); + isolate, ErrorUtils::Construct(isolate, args.target(), args.new_target(), + args.atOrUndefined(isolate, 1))); } // static @@ -85,53 +70,5 @@ BUILTIN(ErrorPrototypeToString) { ErrorUtils::ToString(isolate, args.receiver())); } -namespace { - -Object MakeGenericError(Isolate* isolate, BuiltinArguments args, - Handle<JSFunction> constructor) { - Handle<Object> template_index = args.atOrUndefined(isolate, 1); - Handle<Object> arg0 = args.atOrUndefined(isolate, 2); - Handle<Object> arg1 = args.atOrUndefined(isolate, 3); - Handle<Object> arg2 = args.atOrUndefined(isolate, 4); - - DCHECK(template_index->IsSmi()); - - return *ErrorUtils::MakeGenericError( - isolate, constructor, MessageTemplateFromInt(Smi::ToInt(*template_index)), - arg0, arg1, arg2, SKIP_NONE); -} - -} // namespace - -BUILTIN(MakeError) { - HandleScope scope(isolate); - return MakeGenericError(isolate, args, isolate->error_function()); -} - -BUILTIN(MakeRangeError) { - HandleScope scope(isolate); - return MakeGenericError(isolate, args, isolate->range_error_function()); -} - -BUILTIN(MakeSyntaxError) { - HandleScope scope(isolate); - return MakeGenericError(isolate, args, isolate->syntax_error_function()); -} - -BUILTIN(MakeTypeError) { - HandleScope scope(isolate); - return MakeGenericError(isolate, args, isolate->type_error_function()); -} - -BUILTIN(MakeURIError) { - HandleScope scope(isolate); - Handle<JSFunction> constructor = isolate->uri_error_function(); - Handle<Object> undefined = isolate->factory()->undefined_value(); - MessageTemplate template_index = MessageTemplate::kURIMalformed; - return *ErrorUtils::MakeGenericError(isolate, constructor, template_index, - undefined, undefined, undefined, - SKIP_NONE); -} - } // namespace internal } // namespace v8 |