~ubuntu-branches/ubuntu/vivid/mozjs24/vivid

« back to all changes in this revision

Viewing changes to js/src/tests/test262/ch10/10.6/S10.6_A5_T1.js

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2009 the Sputnik authors.  All rights reserved.
 
2
// This code is governed by the BSD license found in the LICENSE file.
 
3
 
 
4
/**
 
5
 * A property is created with name length with property
 
6
 * attributes { DontEnum } and no others
 
7
 *
 
8
 * @path ch10/10.6/S10.6_A5_T1.js
 
9
 * @description Checking existence of arguments.length property
 
10
 */
 
11
 
 
12
//CHECK#1
 
13
function f1(){
 
14
  return arguments.hasOwnProperty("length");
 
15
}
 
16
try{
 
17
  if(f1() !== true){
 
18
    $ERROR("#1: arguments object doesn't contains property 'length'");
 
19
  }
 
20
}
 
21
catch(e){
 
22
  $ERROR("#1: arguments object doesn't exists");
 
23
}
 
24
 
 
25
//CHECK#2
 
26
var f2 = function(){return arguments.hasOwnProperty("length");};
 
27
try{
 
28
  if(f2() !== true){
 
29
    $ERROR("#2: arguments object doesn't contains property 'length'");
 
30
  }
 
31
}
 
32
catch(e){
 
33
  $ERROR("#2: arguments object doesn't exists");
 
34
}
 
35