js/src/tests/test262/ch11/11.13/11.13.2/S11.13.2_A4.6_T2.5.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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  * The production x <<= y is the same as x = x << y
     6  *
     7  * @path ch11/11.13/11.13.2/S11.13.2_A4.6_T2.5.js
     8  * @description Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)
     9  */
    11 //CHECK#1
    12 x = true;
    13 x <<= "1";
    14 if (x !== 2) {
    15   $ERROR('#1: x = true; x <<= "1"; x === 2. Actual: ' + (x));
    16 }
    18 //CHECK#2
    19 x = "1";
    20 x <<= true;
    21 if (x !== 2) {
    22   $ERROR('#2: x = "1"; x <<= true; x === 2. Actual: ' + (x));
    23 }
    25 //CHECK#3
    26 x = new Boolean(true);
    27 x <<= "1";
    28 if (x !== 2) {
    29   $ERROR('#3: x = new Boolean(true); x <<= "1"; x === 2. Actual: ' + (x));
    30 }
    32 //CHECK#4
    33 x = "1";
    34 x <<= new Boolean(true);
    35 if (x !== 2) {
    36   $ERROR('#4: x = "1"; x <<= new Boolean(true); x === 2. Actual: ' + (x));
    37 }
    39 //CHECK#5
    40 x = true;
    41 x <<= new String("1");
    42 if (x !== 2) {
    43   $ERROR('#5: x = true; x <<= new String("1"); x === 2. Actual: ' + (x));
    44 }
    46 //CHECK#6
    47 x = new String("1");
    48 x <<= true;
    49 if (x !== 2) {
    50   $ERROR('#6: x = new String("1"); x <<= true; x === 2. Actual: ' + (x));
    51 }
    53 //CHECK#7
    54 x = new Boolean(true);
    55 x <<= new String("1");
    56 if (x !== 2) {
    57   $ERROR('#7: x = new Boolean(true); x <<= new String("1"); x === 2. Actual: ' + (x));
    58 }
    60 //CHECK#8
    61 x = new String("1");
    62 x <<= new Boolean(true);
    63 if (x !== 2) {
    64   $ERROR('#8: x = new String("1"); x <<= new Boolean(true); x === 2. Actual: ' + (x));
    65 }

mercurial