tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S15.3.5.1_A3_T1.js (943B)


      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 info: the length property has the attributes { ReadOnly }
      6 es5id: 15.3.5.1_A3_T1
      7 description: >
      8    Checking if varying the length property of
      9    Function("arg1,arg2,arg3","arg4,arg5", null) fails
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 var f = new Function("arg1,arg2,arg3", "arg4,arg5", null);
     14 
     15 assert(f.hasOwnProperty('length'));
     16 
     17 var flength = f.length;
     18 
     19 verifyNotWritable(f, "length", null, function() {});
     20 
     21 assert.sameValue(f.length, flength);
     22 
     23 try {
     24  f.length();
     25  throw new Test262Error('#3: the function.length property has the attributes ReadOnly');
     26 } catch (e) {
     27  if (e instanceof Test262Error) {
     28    throw e;
     29  }
     30 }
     31 
     32 if (f.length !== 5) {
     33  throw new Test262Error('#4: the length property has the attributes { ReadOnly }');
     34 }
     35 
     36 // TODO: Convert to verifyProperty() format.
     37 
     38 reportCompare(0, 0);