OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 ["collectStackTrace"]); | 284 ["collectStackTrace"]); |
285 testTrace("testStrippedCustomError", testStrippedCustomError, ["hep-hey"], | 285 testTrace("testStrippedCustomError", testStrippedCustomError, ["hep-hey"], |
286 ["new CustomError", "collectStackTrace"]); | 286 ["new CustomError", "collectStackTrace"]); |
287 testTrace("testClassNames", testClassNames, | 287 testTrace("testClassNames", testClassNames, |
288 ["new MyObj", "MyObjCreator.Create"], ["as Create"]); | 288 ["new MyObj", "MyObjCreator.Create"], ["as Create"]); |
289 testCallerCensorship(); | 289 testCallerCensorship(); |
290 testUnintendedCallerCensorship(); | 290 testUnintendedCallerCensorship(); |
291 testErrorsDuringFormatting(); | 291 testErrorsDuringFormatting(); |
292 | 292 |
293 testTraceNativeConversion(String); // Does ToString on argument. | 293 testTraceNativeConversion(String); // Does ToString on argument. |
294 testTraceNativeConversion(Number); // Does ToNumber on argument. | |
295 testTraceNativeConversion(RegExp); // Does ToString on argument. | 294 testTraceNativeConversion(RegExp); // Does ToString on argument. |
296 | 295 |
297 testTraceNativeConstructor(String); // Does ToString on argument. | 296 testTraceNativeConstructor(String); // Does ToString on argument. |
298 testTraceNativeConstructor(Number); // Does ToNumber on argument. | |
299 testTraceNativeConstructor(RegExp); // Does ToString on argument. | 297 testTraceNativeConstructor(RegExp); // Does ToString on argument. |
300 | 298 |
301 // Omitted because QuickSort has builtins object as receiver, and is non-native | 299 // Omitted because QuickSort has builtins object as receiver, and is non-native |
302 // builtin. | 300 // builtin. |
303 testOmittedBuiltin(function(){ [thrower, 2].sort(function (a,b) { | 301 testOmittedBuiltin(function(){ [thrower, 2].sort(function (a,b) { |
304 (b < a) - (a < b); }); | 302 (b < a) - (a < b); }); |
305 }, "QuickSort"); | 303 }, "QuickSort"); |
306 | 304 |
307 // Omitted because ADD from runtime.js is non-native builtin. | 305 // Omitted because ADD from runtime.js is non-native builtin. |
308 testOmittedBuiltin(function(){ thrower + 2; }, "ADD"); | 306 testOmittedBuiltin(function(){ thrower + 2; }, "ADD"); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 359 |
362 my_error = {}; | 360 my_error = {}; |
363 Object.preventExtensions(my_error); | 361 Object.preventExtensions(my_error); |
364 assertThrows(function() { Error.captureStackTrace(my_error); }); | 362 assertThrows(function() { Error.captureStackTrace(my_error); }); |
365 | 363 |
366 var fake_error = {}; | 364 var fake_error = {}; |
367 my_error = new Error(); | 365 my_error = new Error(); |
368 var stolen_getter = Object.getOwnPropertyDescriptor(my_error, 'stack').get; | 366 var stolen_getter = Object.getOwnPropertyDescriptor(my_error, 'stack').get; |
369 Object.defineProperty(fake_error, 'stack', { get: stolen_getter }); | 367 Object.defineProperty(fake_error, 'stack', { get: stolen_getter }); |
370 assertEquals(undefined, fake_error.stack); | 368 assertEquals(undefined, fake_error.stack); |
OLD | NEW |