Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * Closures are admitted
6 *
7 * @path ch13/13.2/S13.2.1_A5_T1.js
8 * @description Sorting with closure
9 */
11 var __arr = [4,3,2,1,4,3,2,1,4,3,2,1];
12 //Sort uses closure
13 //
14 __arr.sort(
15 function(x,y) {
16 if (x>y){return -1;}
17 if (x<y){return 1;}
18 if (x==y){return 0;}
19 }
20 );
22 //////////////////////////////////////////////////////////////////////////////
23 //CHECK#1
24 if (__arr.toString() !== [4,4,4,3,3,3,2,2,2,1,1,1].toString()) {
25 $ERROR('#1: __arr.toString() === [4,4,4,3,3,3,2,2,2,1,1,1].toString(). Actual: __arr.toString() ==='+__arr.toString());
26 }
28 //
29 //////////////////////////////////////////////////////////////////////////////