/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* * *Date:06November2002 *SUMMARY:arr.sort()shouldnotoutput|undefined|when|arr|isempty *Seehttp://bugzilla.mozilla.org/show_bug.cgi?id=178722 * *ECMA-262Ed.3:15.4.4.11Array.prototype.sort(comparefn) * *1.Callthe[[Get]]methodofthisobjectwithargument"length". *2.CallToUint32(Result(1)). *3.Performanimplementation-dependentsequenceofcallstothe[[Get]], *[[Put]],and[[Delete]]methodsofthisobject,etc.etc. *4.Returnthisobject. * * *Notethatsort()isdonein-placeon|arr|.Inotherwords,sort()isa *"destructive"methodratherthana"functional"method.Thereturnvalue *of|arr.sort()|and|arr|arethesameobject. * *If|arr|isanemptyarray,thereturnvalueof|arr.sort()|shouldbe *anemptyarray,notthevalue|undefined|aswasoccurringinbug178722. *
*/ //----------------------------------------------------------------------------- var UBound = 0; var BUGNUMBER = 178722; var summary = 'arr.sort() should not output |undefined| when |arr| is empty'; var status = ''; var statusitems = []; var actual = ''; var actualvalues = []; var expect= ''; var expectedvalues = []; var arr;
// create empty array or pseudo-array objects in various ways function f () {return arguments}; var arr5 = f();
arr5.__proto__ = Array.prototype;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.