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

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: add regression test case 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') | no next file with comments »
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 function GetStackTraceLine(recv, fun, pos, isGlobal) { 268 function GetStackTraceLine(recv, fun, pos, isGlobal) {
269 return new CallSite(recv, fun, pos, false).toString(); 269 return new CallSite(recv, fun, pos, false).toString();
270 } 270 }
271 271
272 // ---------------------------------------------------------------------------- 272 // ----------------------------------------------------------------------------
273 // Error implementation 273 // Error implementation
274 274
275 function CallSite(receiver, fun, pos, strict_mode) { 275 function CallSite(receiver, fun, pos, strict_mode) {
276 // For wasm frames, receiver is the wasm object and fun is the function index 276 // For wasm frames, receiver is the wasm object and fun is the function index
277 // instead of an actual function. 277 // instead of an actual function.
278 if (!IS_FUNCTION(fun) && !IS_NUMBER(fun)) { 278 if (!IS_FUNCTION(fun) && !%IsWasmObject(receiver)) {
279 throw MakeTypeError(kCallSiteExpectsFunction, typeof fun); 279 throw MakeTypeError(kCallSiteExpectsFunction, typeof receiver, typeof fun);
280 } 280 }
281 281
282 if (IS_UNDEFINED(new.target)) { 282 if (IS_UNDEFINED(new.target)) {
283 return new CallSite(receiver, fun, pos, strict_mode); 283 return new CallSite(receiver, fun, pos, strict_mode);
284 } 284 }
285 285
286 if (IS_FUNCTION(fun)) { 286 if (IS_FUNCTION(fun)) {
287 SET_PRIVATE(this, callSiteReceiverSymbol, receiver); 287 SET_PRIVATE(this, callSiteReceiverSymbol, receiver);
288 SET_PRIVATE(this, callSiteFunctionSymbol, fun); 288 SET_PRIVATE(this, callSiteFunctionSymbol, fun);
289 } else { 289 } else {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 utils.Export(function(to) { 756 utils.Export(function(to) {
757 to.ErrorToString = ErrorToString; 757 to.ErrorToString = ErrorToString;
758 to.MakeError = MakeError; 758 to.MakeError = MakeError;
759 to.MakeRangeError = MakeRangeError; 759 to.MakeRangeError = MakeRangeError;
760 to.MakeSyntaxError = MakeSyntaxError; 760 to.MakeSyntaxError = MakeSyntaxError;
761 to.MakeTypeError = MakeTypeError; 761 to.MakeTypeError = MakeTypeError;
762 to.MakeURIError = MakeURIError; 762 to.MakeURIError = MakeURIError;
763 }); 763 });
764 764
765 }); 765 });
OLDNEW
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698