js/src/tests/test262/ch10/10.6/S10.6_A2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch10/10.6/S10.6_A2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +// Copyright 2009 the Sputnik authors.  All rights reserved.
     1.5 +// This code is governed by the BSD license found in the LICENSE file.
     1.6 +
     1.7 +/**
     1.8 + * The value of the internal [[Prototype]] property of the
     1.9 + * created arguments object is the original Object prototype object, the one
    1.10 + * that is the initial value of Object.prototype
    1.11 + *
    1.12 + * @path ch10/10.6/S10.6_A2.js
    1.13 + * @description Checking arguments.constructor.prototype===Object.prototype
    1.14 + */
    1.15 +
    1.16 +//CHECK#1
    1.17 +function f1(){
    1.18 +  return arguments.constructor.prototype;
    1.19 +}
    1.20 +try{
    1.21 +  if(f1() !== Object.prototype){
    1.22 +    $ERROR('#1: arguments.constructor.prototype === Object.prototype');
    1.23 +  }
    1.24 +}
    1.25 +catch(e){
    1.26 +  $ERROR("#1: arguments doesn't exists");
    1.27 +}
    1.28 +
    1.29 +//CHECK#2
    1.30 +var f2 = function(){return arguments.constructor.prototype;};
    1.31 +try{
    1.32 +  if(f2() !== Object.prototype){
    1.33 +    $ERROR('#2: arguments.constructor.prototype === Object.prototype');
    1.34 +  }
    1.35 +}
    1.36 +catch(e){
    1.37 +  $ERROR("#2: arguments doesn't exists");
    1.38 +}
    1.39 +

mercurial