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

Side by Side Diff: src/js/messages.js

Issue 2010493002: Check CallSite arguments more rigorously (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove unneeded cast Created 4 years, 6 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 | « no previous file | src/messages.h » ('j') | src/messages.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 (function(global, utils) { 7 (function(global, utils) {
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 function GetStackTraceLine(recv, fun, pos, isGlobal) { 449 function GetStackTraceLine(recv, fun, pos, isGlobal) {
450 return new CallSite(recv, fun, pos, false).toString(); 450 return new CallSite(recv, fun, pos, false).toString();
451 } 451 }
452 452
453 // ---------------------------------------------------------------------------- 453 // ----------------------------------------------------------------------------
454 // Error implementation 454 // Error implementation
455 455
456 function CallSite(receiver, fun, pos, strict_mode) { 456 function CallSite(receiver, fun, pos, strict_mode) {
457 // For wasm frames, receiver is the wasm object and fun is the function index 457 // For wasm frames, receiver is the wasm object and fun is the function index
458 // instead of an actual function. 458 // instead of an actual function.
459 if (!IS_FUNCTION(fun) && !IS_NUMBER(fun)) { 459 if (!IS_FUNCTION(fun) && !%IsWasmObject(receiver)) {
460 throw MakeTypeError(kCallSiteExpectsFunction, typeof fun); 460 throw MakeTypeError(kCallSiteExpectsFunction, typeof receiver, typeof fun);
461 } 461 }
462 462
463 if (IS_UNDEFINED(new.target)) { 463 if (IS_UNDEFINED(new.target)) {
464 return new CallSite(receiver, fun, pos, strict_mode); 464 return new CallSite(receiver, fun, pos, strict_mode);
465 } 465 }
466 466
467 if (IS_FUNCTION(fun)) { 467 if (IS_FUNCTION(fun)) {
468 SET_PRIVATE(this, callSiteReceiverSymbol, receiver); 468 SET_PRIVATE(this, callSiteReceiverSymbol, receiver);
469 SET_PRIVATE(this, callSiteFunctionSymbol, fun); 469 SET_PRIVATE(this, callSiteFunctionSymbol, fun);
470 } else { 470 } else {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 utils.Export(function(to) { 937 utils.Export(function(to) {
938 to.ErrorToString = ErrorToString; 938 to.ErrorToString = ErrorToString;
939 to.MakeError = MakeError; 939 to.MakeError = MakeError;
940 to.MakeRangeError = MakeRangeError; 940 to.MakeRangeError = MakeRangeError;
941 to.MakeSyntaxError = MakeSyntaxError; 941 to.MakeSyntaxError = MakeSyntaxError;
942 to.MakeTypeError = MakeTypeError; 942 to.MakeTypeError = MakeTypeError;
943 to.MakeURIError = MakeURIError; 943 to.MakeURIError = MakeURIError;
944 }); 944 });
945 945
946 }); 946 });
OLDNEW
« no previous file with comments | « no previous file | src/messages.h » ('j') | src/messages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698