/* -*- 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:26June2002 *SUMMARY:Testingarray.join()whenseparatorisavariable,notaliteral *Seehttp://bugzilla.mozilla.org/show_bug.cgi?id=154338 *
*/ //----------------------------------------------------------------------------- var UBound = 0; var BUGNUMBER = 154338; var summary = 'Test array.join() when separator is a variable, not a literal'; var status = ''; var statusitems = []; var actual = ''; var actualvalues = []; var expect= ''; var expectedvalues = [];
/* *Notethatx==='H'andy==='ome'. * *Yetforsomereason,using|x|or|y|astheseparator *inarr.join()wascausingout-of-memoryerrors,whereas *usingtheliterals'H','ome'wasnot- *
*/ var x = 'Home'[0]; var y = ('Home'.split('H'))[1];
status = inSection(1); var arr = Array('a', 'b');
actual = arr.join('H');
expect = 'aHb';
addThis();
status = inSection(2);
arr = Array('a', 'b');
actual = arr.join(x);
expect = 'aHb';
addThis();
status = inSection(3);
arr = Array('a', 'b');
actual = arr.join('ome');
expect = 'aomeb';
addThis();
status = inSection(4);
arr = Array('a', 'b');
actual = arr.join(y);
expect = 'aomeb';
addThis();
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.