| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 testTraceNativeConstructor(String); // Does ToString on argument. | 299 testTraceNativeConstructor(String); // Does ToString on argument. |
| 300 testTraceNativeConstructor(RegExp); // Does ToString on argument. | 300 testTraceNativeConstructor(RegExp); // Does ToString on argument. |
| 301 | 301 |
| 302 // Omitted because QuickSort has builtins object as receiver, and is non-native | 302 // Omitted because QuickSort has builtins object as receiver, and is non-native |
| 303 // builtin. | 303 // builtin. |
| 304 testOmittedBuiltin(function(){ [thrower, 2].sort(function (a,b) { | 304 testOmittedBuiltin(function(){ [thrower, 2].sort(function (a,b) { |
| 305 (b < a) - (a < b); }); | 305 (b < a) - (a < b); }); |
| 306 }, "QuickSort"); | 306 }, "QuickSort"); |
| 307 | 307 |
| 308 // Omitted because ADD from runtime.js is non-native builtin. | |
| 309 testOmittedBuiltin(function(){ thrower + 2; }, "ADD"); | |
| 310 | |
| 311 var reached = false; | 308 var reached = false; |
| 312 var error = new Error(); | 309 var error = new Error(); |
| 313 error.toString = function() { reached = true; }; | 310 error.toString = function() { reached = true; }; |
| 314 error.stack; | 311 error.stack; |
| 315 assertFalse(reached); | 312 assertFalse(reached); |
| 316 | 313 |
| 317 reached = false; | 314 reached = false; |
| 318 error = new Error(); | 315 error = new Error(); |
| 319 Array.prototype.push = function(x) { reached = true; }; | 316 Array.prototype.push = function(x) { reached = true; }; |
| 320 Array.prototype.join = function(x) { reached = true; }; | 317 Array.prototype.join = function(x) { reached = true; }; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 assertTrue(err.stack.indexOf("prepareStackTrace") != -1); | 430 assertTrue(err.stack.indexOf("prepareStackTrace") != -1); |
| 434 | 431 |
| 435 // Check that the callsite constructor throws. | 432 // Check that the callsite constructor throws. |
| 436 | 433 |
| 437 Error.prepareStackTrace = (e,s) => s; | 434 Error.prepareStackTrace = (e,s) => s; |
| 438 var constructor = new Error().stack[0].constructor; | 435 var constructor = new Error().stack[0].constructor; |
| 439 | 436 |
| 440 assertThrows(() => constructor.call()); | 437 assertThrows(() => constructor.call()); |
| 441 assertThrows(() => constructor.call( | 438 assertThrows(() => constructor.call( |
| 442 null, {}, () => undefined, {valueOf() { return 0 }}, false)); | 439 null, {}, () => undefined, {valueOf() { return 0 }}, false)); |
| OLD | NEW |