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

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

Issue 2814043006: [errors] Improve NotGeneric error message (Closed)
Patch Set: Address comments Created 3 years, 8 months 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
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory> 7 #include <memory>
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 282
283 RUNTIME_FUNCTION(Runtime_ThrowNotConstructor) { 283 RUNTIME_FUNCTION(Runtime_ThrowNotConstructor) {
284 HandleScope scope(isolate); 284 HandleScope scope(isolate);
285 DCHECK_EQ(1, args.length()); 285 DCHECK_EQ(1, args.length());
286 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 286 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
287 THROW_NEW_ERROR_RETURN_FAILURE( 287 THROW_NEW_ERROR_RETURN_FAILURE(
288 isolate, NewTypeError(MessageTemplate::kNotConstructor, object)); 288 isolate, NewTypeError(MessageTemplate::kNotConstructor, object));
289 } 289 }
290 290
291 RUNTIME_FUNCTION(Runtime_ThrowNotGeneric) {
292 HandleScope scope(isolate);
293 DCHECK_EQ(1, args.length());
294 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 0);
295 THROW_NEW_ERROR_RETURN_FAILURE(
296 isolate, NewTypeError(MessageTemplate::kNotGeneric, arg0));
297 }
298
299 RUNTIME_FUNCTION(Runtime_ThrowGeneratorRunning) { 291 RUNTIME_FUNCTION(Runtime_ThrowGeneratorRunning) {
300 HandleScope scope(isolate); 292 HandleScope scope(isolate);
301 DCHECK_EQ(0, args.length()); 293 DCHECK_EQ(0, args.length());
302 THROW_NEW_ERROR_RETURN_FAILURE( 294 THROW_NEW_ERROR_RETURN_FAILURE(
303 isolate, NewTypeError(MessageTemplate::kGeneratorRunning)); 295 isolate, NewTypeError(MessageTemplate::kGeneratorRunning));
304 } 296 }
305 297
306 RUNTIME_FUNCTION(Runtime_ThrowApplyNonFunction) { 298 RUNTIME_FUNCTION(Runtime_ThrowApplyNonFunction) {
307 HandleScope scope(isolate); 299 HandleScope scope(isolate);
308 DCHECK_EQ(1, args.length()); 300 DCHECK_EQ(1, args.length());
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 THROW_NEW_ERROR_RETURN_FAILURE( 568 THROW_NEW_ERROR_RETURN_FAILURE(
577 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid)); 569 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid));
578 } 570 }
579 571
580 return *isolate->factory()->NewJSAsyncFromSyncIterator( 572 return *isolate->factory()->NewJSAsyncFromSyncIterator(
581 Handle<JSReceiver>::cast(sync_iterator)); 573 Handle<JSReceiver>::cast(sync_iterator));
582 } 574 }
583 575
584 } // namespace internal 576 } // namespace internal
585 } // namespace v8 577 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698