js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A3.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  * If ShiftExpression is not an object, throw TypeError
     6  *
     7  * @path ch11/11.8/11.8.7/S11.8.7_A3.js
     8  * @description Checking all the types of primitives
     9  */
    11 //CHECK#1
    12 try {
    13   "toString" in true;
    14   $ERROR('#1: "toString" in true throw TypeError');  
    15 }
    16 catch (e) {
    17   if ((e instanceof TypeError) !== true) {
    18     $ERROR('#1: "toString" in true throw TypeError');  
    19   }
    20 }
    22 //CHECK#2
    23 try {
    24   "MAX_VALUE" in 1;
    25   $ERROR('#2: "MAX_VALUE" in 1 throw TypeError');  
    26 }
    27 catch (e) {
    28   if ((e instanceof TypeError) !== true) {
    29     $ERROR('#2: "MAX_VALUE" in 1 throw TypeError');  
    30   }
    31 }
    33 //CHECK#3
    34 try {
    35   "length" in "string";
    36   $ERROR('#3: "length" in "string" throw TypeError');  
    37 }
    38 catch (e) {
    39   if ((e instanceof TypeError) !== true) {
    40     $ERROR('#3: "length" in "string" throw TypeError');  
    41   }
    42 }
    44 //CHECK#4
    45 try {
    46   "toString" in undefined;
    47   $ERROR('#4: "toString" in undefined throw TypeError');  
    48 }
    49 catch (e) {
    50   if ((e instanceof TypeError) !== true) {
    51     $ERROR('#4: "toString" in undefined throw TypeError');  
    52   }
    53 }
    55 //CHECK#5
    56 try {
    57   "toString" in null;
    58   $ERROR('#5: "toString" in null throw TypeError');  
    59 }
    60 catch (e) {
    61   if ((e instanceof TypeError) !== true) {
    62     $ERROR('#5: "toString" in null throw TypeError');  
    63   }
    64 }

mercurial