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

Side by Side Diff: src/messages.js

Issue 234703006: Prevent real stack overflow when handling JavaScript stack overflow (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/stack-traces-overflow.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 DefineError(function SyntaxError() { }); 1238 DefineError(function SyntaxError() { });
1239 DefineError(function ReferenceError() { }); 1239 DefineError(function ReferenceError() { });
1240 DefineError(function EvalError() { }); 1240 DefineError(function EvalError() { });
1241 DefineError(function URIError() { }); 1241 DefineError(function URIError() { });
1242 } 1242 }
1243 1243
1244 SetUpError(); 1244 SetUpError();
1245 1245
1246 $Error.captureStackTrace = captureStackTrace; 1246 $Error.captureStackTrace = captureStackTrace;
1247 1247
1248 // Make sure there are no setters/getters on stackTraceLimit
1249 %SetProperty($Error, 'stackTraceLimit', UNDEFINED, DONT_DELETE);
1250
1248 %SetProperty($Error.prototype, 'message', '', DONT_ENUM); 1251 %SetProperty($Error.prototype, 'message', '', DONT_ENUM);
1249 1252
1250 // Global list of error objects visited during ErrorToString. This is 1253 // Global list of error objects visited during ErrorToString. This is
1251 // used to detect cycles in error toString formatting. 1254 // used to detect cycles in error toString formatting.
1252 var visited_errors = new InternalArray(); 1255 var visited_errors = new InternalArray();
1253 var cyclic_error_marker = new $Object(); 1256 var cyclic_error_marker = new $Object();
1254 1257
1255 function GetPropertyWithoutInvokingMonkeyGetters(error, name) { 1258 function GetPropertyWithoutInvokingMonkeyGetters(error, name) {
1256 var current = error; 1259 var current = error;
1257 // Climb the prototype chain until we find the holder. 1260 // Climb the prototype chain until we find the holder.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 %GetAndClearOverflowedStackTrace(this); 1351 %GetAndClearOverflowedStackTrace(this);
1349 }; 1352 };
1350 1353
1351 %DefineOrRedefineAccessorProperty( 1354 %DefineOrRedefineAccessorProperty(
1352 boilerplate, 'stack', getter, setter, DONT_ENUM); 1355 boilerplate, 'stack', getter, setter, DONT_ENUM);
1353 1356
1354 return boilerplate; 1357 return boilerplate;
1355 } 1358 }
1356 1359
1357 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); 1360 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/stack-traces-overflow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698