diff --git a/js/tests/js1_5/Object/regress-90596-003.js b/js/tests/js1_5/Object/regress-90596-003.js index 7bd8762d6e30..766fff55d191 100644 --- a/js/tests/js1_5/Object/regress-90596-003.js +++ b/js/tests/js1_5/Object/regress-90596-003.js @@ -23,6 +23,13 @@ * See http://bugzilla.mozilla.org/show_bug.cgi?id=90596 * * NOTE: some inefficiencies in the test are made for the sake of readability. +* For example, we quote string values like "Hi" in lines like this: +* +* actual = enumerateThis(obj); +* expect = '{prop:"Hi"}'; +* +* But enumerateThis(obj) gets literal value Hi for obj.prop, not literal "Hi". +* We take care of all these details in the compactThis(), sortThis() functions. * Sorting properties alphabetically is necessary for the test to work in Rhino. */ //----------------------------------------------------------------------------- @@ -31,7 +38,6 @@ var bug = 90596; var summary = '[DontEnum] props (if overridden) should appear in for-in loops'; var cnCOMMA = ','; var cnCOLON = ':'; -var cnEMPTY = ''; var cnLBRACE = '{'; var cnRBRACE = '}'; var status = ''; @@ -42,6 +48,7 @@ var expect= ''; var expectedvalues = []; var obj = {}; + status = inSection(1); obj = {toString:9}; actual = enumerateThis(obj); @@ -189,24 +196,24 @@ function addThis() */ function sortThis(sList) { - sList = formatThis(sList); + sList = compactThis(sList); + sList = stripBraces(sList); var arr = sList.split(cnCOMMA); arr = arr.sort(); var ret = String(arr); - return addBraces(ret); + ret = addBraces(ret); + return ret; } /* - * Strips out braces at beginning/end of text, and any whitespace or quotes + * Strips out any whitespace or quotes from the text - */ -function formatThis(text) +function compactThis(text) { var charCode = 0; var ret = ''; - text = stripBraces(text); - for (var i=0; i