js/src/tests/test262/ch11/11.4/11.4.5/S11.4.5_A2.1_T1.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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  * Operator --x uses GetValue and PutValue
     6  *
     7  * @path ch11/11.4/11.4.5/S11.4.5_A2.1_T1.js
     8  * @description Type(x) is Reference and GetBase(x) is not null
     9  */
    11 //CHECK#1
    12 var x = 1;
    13 if (--x !== 1 - 1) {
    14   $ERROR('#1: var x = 1; --x === 1 - 1. Actual: ' + (--x));
    15 } else {
    16   if (x !== 1 - 1) {
    17     $ERROR('#1: var x = 1; --x; x === 1 - 1. Actual: ' + (x));
    18   } 
    19 }
    21 //CHECK#2
    22 this.x = 1;
    23 if (--this.x !== 1 - 1) {
    24   $ERROR('#2: this.x = 1; --this.x === 1 - 1. Actual: ' + (--this.x));
    25 } else {
    26   if (this.x !== 1 - 1) {
    27     $ERROR('#2: this.x = 1; --this.x; this.x === 1 - 1. Actual: ' + (this.x));
    28   } 
    29 }
    31 //CHECK#3
    32 var object = new Object();
    33 object.prop = 1;
    34 if (--object.prop !== 1 - 1) {
    35   $ERROR('#3: var object = new Object(); object.prop = 1; --object.prop === 1 - 1. Actual: ' + (--object.prop));
    36 } else {
    37   if (this.x !== 1 - 1) {
    38     $ERROR('#3: var object = new Object(); object.prop = 1; --object.prop; object.prop === 1 - 1. Actual: ' + (object.prop));
    39   } 
    40 }

mercurial