2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: the length property has the attributes { ReadOnly }
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 15.3.5.1_A3_T3
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Checking if varying the length property of
|
|
|
|
Function("arg1,arg2,arg3","arg1,arg2","arg3", null) fails
|
2015-06-09 18:08:02 +02:00
|
|
|
includes: [propertyHelper.js]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2018-02-15 21:49:19 +01:00
|
|
|
var f = new Function("arg1,arg2,arg3", "arg1,arg2", "arg3", null);
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2021-08-11 20:53:42 +02:00
|
|
|
assert(f.hasOwnProperty('length'));
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2015-05-14 17:22:12 +02:00
|
|
|
var flength = f.length;
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2018-02-15 21:49:19 +01:00
|
|
|
verifyNotWritable(f, "length", null, function() {});
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2021-08-11 20:53:42 +02:00
|
|
|
assert.sameValue(f.length, flength);
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
try {
|
|
|
|
f.length();
|
2021-07-22 19:31:45 +02:00
|
|
|
throw new Test262Error('#3: the function.length property has the attributes ReadOnly');
|
2011-09-07 08:35:18 +02:00
|
|
|
} catch (e) {
|
2021-08-11 20:53:42 +02:00
|
|
|
if (e instanceof Test262Error) {
|
|
|
|
throw e;
|
|
|
|
}
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (f.length !== 6) {
|
2021-07-22 19:31:45 +02:00
|
|
|
throw new Test262Error('#4: the length property has the attributes { ReadOnly }');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
2021-08-11 20:53:42 +02:00
|
|
|
|
|
|
|
// TODO: Convert to verifyProperty() format.
|