Commit 76193d4b authored by jgruber's avatar jgruber Committed by Commit bot

Fix several stack-traces tests using assertUnreachable()

These tests all called assertUnreachable within a try/catch block.

BUG=v8:5246

Review-Url: https://codereview.chromium.org/2209663003
Cr-Commit-Position: refs/heads/master@{#38323}
parent 39a5998f
......@@ -252,11 +252,14 @@ function testTraceNativeConversion(nativeFunc) {
function testOmittedBuiltin(throwing, omitted) {
var reached = false;
try {
throwing();
assertUnreachable(omitted);
reached = true;
} catch (e) {
assertTrue(e.stack.indexOf(omitted) < 0, omitted);
} finally {
assertFalse(reached);
}
}
......@@ -305,19 +308,18 @@ testOmittedBuiltin(function(){ [thrower, 2].sort(function (a,b) {
// Omitted because ADD from runtime.js is non-native builtin.
testOmittedBuiltin(function(){ thrower + 2; }, "ADD");
var reached = false;
var error = new Error();
error.toString = function() { assertUnreachable(); };
error.toString = function() { reached = true; };
error.stack;
assertFalse(reached);
reached = false;
error = new Error();
error.name = { toString: function() { assertUnreachable(); }};
error.message = { toString: function() { assertUnreachable(); }};
error.stack;
error = new Error();
Array.prototype.push = function(x) { assertUnreachable(); };
Array.prototype.join = function(x) { assertUnreachable(); };
Array.prototype.push = function(x) { reached = true; };
Array.prototype.join = function(x) { reached = true; };
error.stack;
assertFalse(reached);
var fired = false;
error = new Error({ toString: function() { fired = true; } });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment