Skip to content

Commit

Permalink
Drop support for the "negative" flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorkem Yakin committed Sep 24, 2015
1 parent 65aa9f3 commit 9b91134
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var errorLogRe = /^test262\/error (.*)$/;
// errorStack: stack trace of error thrown (used for debugging purposes)
Runner.prototype.validateResult = function(test, result) {
var expectingStack = false;
var isNegative = test.attrs.flags.negative || test.attrs.negative;
var negative = test.attrs.negative;
// parse result from log
(result.log || []).forEach(function(log) {
var errorMatch = log.match(errorLogRe);
Expand Down Expand Up @@ -203,17 +203,13 @@ Runner.prototype.validateResult = function(test, result) {
test.errorMessage = result.errorMessage;
test.errorStack = result.errorStack;

if(isNegative) {
if(test.attrs.negative) {
// failure can either match against error name, or an exact match
// against error message (the latter case is thus far only to support
// NotEarlyError thrown errors which have an error type of "Error").
test.pass =
!!result.errorName.match(new RegExp(test.attrs.negative)) ||
result.errorMessage === test.attrs.negative;
} else {
test.pass = true
}
if(negative) {
// failure can either match against error name, or an exact match
// against error message (the latter case is thus far only to support
// NotEarlyError thrown errors which have an error type of "Error").
test.pass =
!!result.errorName.match(new RegExp(negative)) ||
result.errorMessage === negative;
} else {
test.pass = false
}
Expand All @@ -223,7 +219,7 @@ Runner.prototype.validateResult = function(test, result) {
test.pass = false;
test.errorName = "Test262 Error";
test.errorMessage = "Test did not run to completion ($DONE not called)";
} else if(isNegative) {
} else if(negative) {
test.pass = false;
} else {
test.pass = true;
Expand Down

0 comments on commit 9b91134

Please sign in to comment.