From 4a4b951bfcf0e0b2323ea94735a1c9db7d08ecd7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 17 Mar 2018 16:59:17 +0100 Subject: Simplify Error Xray code --- js/xpconnect/tests/chrome/test_xrayToJS.xul | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'js/xpconnect/tests/chrome') diff --git a/js/xpconnect/tests/chrome/test_xrayToJS.xul b/js/xpconnect/tests/chrome/test_xrayToJS.xul index 2f4e70f47..8e6b0f8a4 100644 --- a/js/xpconnect/tests/chrome/test_xrayToJS.xul +++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul @@ -220,11 +220,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681 // There is no TypedArray constructor, looks like. is(window.TypedArray, undefined, "If this ever changes, add to this test!"); for (var c of errorObjectClasses) { - gPrototypeProperties[c] = ["constructor", "name", - // We don't actually resolve these empty data properties - // onto the Xray prototypes, but we list them here to make - // the test happy. - "lineNumber", "columnNumber", "fileName", "message", "stack"]; + gPrototypeProperties[c] = ["constructor", "name", "message", "stack"]; gConstructorProperties[c] = constructorProps([]); } // toString and toSource only live on the parent proto (Error.prototype). @@ -791,8 +787,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681 // We only invoke testXray with Error, because that function isn't set up // to deal with dependent classes and fixing it up is more trouble than // it's worth. - testXray('Error', new iwin.Error('some error message'), new iwin.Error(), - ['fileName', 'lineNumber', 'columnNumber', 'message']); + testXray('Error', new iwin.Error('some error message'), new iwin.Error()); // Make sure that the dependent classes have their prototypes set up correctly. for (let c of errorObjectClasses.filter(x => x != "Error")) { @@ -806,7 +801,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681 e.wrappedJSObject[name] = goodReplacement; is(e[name], goodReplacement, name + " property ok after replacement: " + goodReplacement); e.wrappedJSObject[name] = faultyReplacement; - is(e[name], undefined, name + " property censored after suspicious replacement"); + is(e[name], name == 'message' ? "" : undefined, name + " property skipped after suspicious replacement"); } testProperty('message', x => x == 'some message', 'some other message', 42); testProperty('fileName', x => x == '', 'otherFilename.html', new iwin.Object()); -- cgit v1.2.3