diff --git a/tools/lint/test/fixtures/harness/propertyHelper.js b/tools/lint/test/fixtures/harness/propertyHelper.js index 4a4081fcf4..2b8776d72d 100644 --- a/tools/lint/test/fixtures/harness/propertyHelper.js +++ b/tools/lint/test/fixtures/harness/propertyHelper.js @@ -106,7 +106,7 @@ function isConfigurable(obj, name) { delete obj[name]; } catch (e) { if (!(e instanceof TypeError)) { - $ERROR("Expected TypeError, got " + e); + throw new Test262Error("Expected TypeError, got " + e); } } return !hasOwnProperty.call(obj, name); @@ -149,7 +149,7 @@ function isWritable(obj, name, verifyProp, value) { obj[name] = newValue; } catch (e) { if (!(e instanceof TypeError)) { - $ERROR("Expected TypeError, got " + e); + throw new Test262Error("Expected TypeError, got " + e); } } @@ -171,7 +171,7 @@ function isWritable(obj, name, verifyProp, value) { function verifyEqualTo(obj, name, value) { if (!isSameValue(obj[name], value)) { - $ERROR("Expected obj[" + String(name) + "] to equal " + value + + throw new Test262Error("Expected obj[" + String(name) + "] to equal " + value + ", actually " + obj[name]); } } @@ -182,7 +182,7 @@ function verifyWritable(obj, name, verifyProp, value) { "Expected obj[" + String(name) + "] to have writable:true."); } if (!isWritable(obj, name, verifyProp, value)) { - $ERROR("Expected obj[" + String(name) + "] to be writable, but was not."); + throw new Test262Error("Expected obj[" + String(name) + "] to be writable, but was not."); } } @@ -192,7 +192,7 @@ function verifyNotWritable(obj, name, verifyProp, value) { "Expected obj[" + String(name) + "] to have writable:false."); } if (isWritable(obj, name, verifyProp)) { - $ERROR("Expected obj[" + String(name) + "] NOT to be writable, but was."); + throw new Test262Error("Expected obj[" + String(name) + "] NOT to be writable, but was."); } } @@ -200,7 +200,7 @@ function verifyEnumerable(obj, name) { assert(Object.getOwnPropertyDescriptor(obj, name).enumerable, "Expected obj[" + String(name) + "] to have enumerable:true."); if (!isEnumerable(obj, name)) { - $ERROR("Expected obj[" + String(name) + "] to be enumerable, but was not."); + throw new Test262Error("Expected obj[" + String(name) + "] to be enumerable, but was not."); } } @@ -208,7 +208,7 @@ function verifyNotEnumerable(obj, name) { assert(!Object.getOwnPropertyDescriptor(obj, name).enumerable, "Expected obj[" + String(name) + "] to have enumerable:false."); if (isEnumerable(obj, name)) { - $ERROR("Expected obj[" + String(name) + "] NOT to be enumerable, but was."); + throw new Test262Error("Expected obj[" + String(name) + "] NOT to be enumerable, but was."); } } @@ -216,7 +216,7 @@ function verifyConfigurable(obj, name) { assert(Object.getOwnPropertyDescriptor(obj, name).configurable, "Expected obj[" + String(name) + "] to have configurable:true."); if (!isConfigurable(obj, name)) { - $ERROR("Expected obj[" + String(name) + "] to be configurable, but was not."); + throw new Test262Error("Expected obj[" + String(name) + "] to be configurable, but was not."); } } @@ -224,6 +224,6 @@ function verifyNotConfigurable(obj, name) { assert(!Object.getOwnPropertyDescriptor(obj, name).configurable, "Expected obj[" + String(name) + "] to have configurable:false."); if (isConfigurable(obj, name)) { - $ERROR("Expected obj[" + String(name) + "] NOT to be configurable, but was."); + throw new Test262Error("Expected obj[" + String(name) + "] NOT to be configurable, but was."); } }