js/src/tests/test262/ch13/13.2/S13.2.1_A5_T1.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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 //////////////////////////////////////////////////////////////////////////////  

mercurial