Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 1507273002: Make Error.prototype.toString spec compliant; and fix various side-effect-free error printing metho… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 286
287 RUNTIME_FUNCTION(Runtime_MessageGetScript) { 287 RUNTIME_FUNCTION(Runtime_MessageGetScript) {
288 SealHandleScope shs(isolate); 288 SealHandleScope shs(isolate);
289 DCHECK(args.length() == 1); 289 DCHECK(args.length() == 1);
290 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); 290 CONVERT_ARG_CHECKED(JSMessageObject, message, 0);
291 return message->script(); 291 return message->script();
292 } 292 }
293 293
294 294
295 RUNTIME_FUNCTION(Runtime_ErrorToStringRT) {
296 HandleScope scope(isolate);
297 DCHECK(args.length() == 1);
298 CONVERT_ARG_HANDLE_CHECKED(JSObject, error, 0);
299 Handle<String> result;
300 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
301 isolate, result,
302 isolate->error_tostring_helper()->Stringify(isolate, error));
303 return *result;
304 }
305
306
307 RUNTIME_FUNCTION(Runtime_FormatMessageString) { 295 RUNTIME_FUNCTION(Runtime_FormatMessageString) {
308 HandleScope scope(isolate); 296 HandleScope scope(isolate);
309 DCHECK(args.length() == 4); 297 DCHECK(args.length() == 4);
310 CONVERT_INT32_ARG_CHECKED(template_index, 0); 298 CONVERT_INT32_ARG_CHECKED(template_index, 0);
311 CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1); 299 CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1);
312 CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2); 300 CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2);
313 CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3); 301 CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3);
314 Handle<String> result; 302 Handle<String> result;
315 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 303 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
316 isolate, result, 304 isolate, result,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 HandleScope scope(isolate); 438 HandleScope scope(isolate);
451 DCHECK_EQ(1, args.length()); 439 DCHECK_EQ(1, args.length());
452 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 440 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
453 Handle<String> callsite = RenderCallSite(isolate, object); 441 Handle<String> callsite = RenderCallSite(isolate, object);
454 THROW_NEW_ERROR_RETURN_FAILURE( 442 THROW_NEW_ERROR_RETURN_FAILURE(
455 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); 443 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite));
456 } 444 }
457 445
458 } // namespace internal 446 } // namespace internal
459 } // namespace v8 447 } // namespace v8
OLDNEW
« src/messages.cc ('K') | « src/runtime/runtime.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698