Browse Source

Test fixes for ES6 Object arg policy

pull/1028/head
Bruce Pascoe 8 years ago
parent
commit
86b72c9c90
  1. 45
      tests/ecmascript/test-bi-object-extensible.js
  2. 8
      tests/ecmascript/test-bi-object-getownpropdesc.js
  3. 10
      tests/ecmascript/test-bi-object-getownpropnames.js
  4. 8
      tests/ecmascript/test-bi-object-getprototypeof.js
  5. 8
      tests/ecmascript/test-bi-object-keys.js
  6. 60
      tests/ecmascript/test-bi-object-seal-freeze.js

45
tests/ecmascript/test-bi-object-extensible.js

@ -47,54 +47,55 @@ try {
/*===
isExtensible 0
TypeError
false
isExtensible 1
TypeError
false
isExtensible 2
TypeError
false
isExtensible 3
TypeError
false
isExtensible 4
TypeError
false
isExtensible 5
TypeError
false
isExtensible 6
true
isExtensible 7
true
preventExtensions 0
TypeError
undefined
preventExtensions 1
TypeError
null
preventExtensions 2
TypeError
true
preventExtensions 3
TypeError
false
preventExtensions 4
TypeError
123
preventExtensions 5
TypeError
foo
preventExtensions 6
1,2,3
preventExtensions 7
[object Object]
===*/
function coercionTest() {
// Note: ES5 behavior was to throw a TypeError for non-object values. ES6
// changes this to treat them as already non-extensible objects instead.
// This goes for undefined and null too, even though they are not normally
// object coercible!
var values = [ undefined, null, true, false, 123, 'foo', [1,2,3], { foo: 1, bar: 1 } ];
for (i = 0; i < values.length; i++) {
print('isExtensible', i);
try {
Object.isExtensible(values[i]);
} catch (e) {
print(e.name);
}
print(Object.isExtensible(values[i]));
}
for (i = 0; i < values.length; i++) {
print('preventExtensions', i);
try {
Object.preventExtensions(values[i]);
} catch (e) {
print(e.name);
}
print(Object.preventExtensions(values[i]));
}
}

8
tests/ecmascript/test-bi-object-getownpropdesc.js

@ -73,10 +73,10 @@ try {
coercion
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
boolean foo undefined ok
boolean foo undefined ok
number foo undefined ok
string foo undefined ok
object foo undefined ok
object foo object 1
function foo undefined ok

10
tests/ecmascript/test-bi-object-getownpropnames.js

@ -54,10 +54,10 @@ coercion
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
object
object
object
object
object
object
object
@ -71,7 +71,7 @@ function coercionTest() {
try {
if (is_noarg) {
t = Object.getOwnPropertyNames(o);
t = Object.getOwnPropertyNames();
} else {
t = Object.getOwnPropertyNames(o);
}

8
tests/ecmascript/test-bi-object-getprototypeof.js

@ -33,10 +33,10 @@ firstarg
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
ok
ok
ok
ok
ok
ok
ok

8
tests/ecmascript/test-bi-object-keys.js

@ -54,10 +54,10 @@ coercion
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
TypeError
object 0
object 0
object 0
object 3
object 2
object 2
===*/

60
tests/ecmascript/test-bi-object-seal-freeze.js

@ -212,81 +212,81 @@ try {
/*===
0 0
TypeError
ok
0 1
TypeError
ok
0 2
TypeError
ok
0 3
TypeError
ok
0 4
TypeError
ok
0 5
TypeError
ok
0 6
ok
0 7
ok
1 0
TypeError
ok
1 1
TypeError
ok
1 2
TypeError
ok
1 3
TypeError
ok
1 4
TypeError
ok
1 5
TypeError
ok
1 6
ok
1 7
ok
2 0
TypeError
ok
2 1
TypeError
ok
2 2
TypeError
ok
2 3
TypeError
ok
2 4
TypeError
ok
2 5
TypeError
ok
2 6
ok
2 7
ok
3 0
TypeError
ok
3 1
TypeError
ok
3 2
TypeError
ok
3 3
TypeError
ok
3 4
TypeError
ok
3 5
TypeError
ok
3 6
ok
3 7
ok
4 0
TypeError
ok
4 1
TypeError
ok
4 2
TypeError
ok
4 3
TypeError
ok
4 4
TypeError
ok
4 5
TypeError
ok
4 6
ok
4 7

Loading…
Cancel
Save