From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../test262/language/types/object/S8.6.1_A1.js | 17 +++++ .../test262/language/types/object/S8.6.1_A2.js | 17 +++++ .../test262/language/types/object/S8.6.1_A3.js | 29 +++++++++ .../test262/language/types/object/S8.6.2_A1.js | 74 ++++++++++++++++++++++ .../test262/language/types/object/S8.6.2_A2.js | 40 ++++++++++++ .../test262/language/types/object/S8.6.2_A3.js | 21 ++++++ .../test262/language/types/object/S8.6.2_A4.js | 56 ++++++++++++++++ .../test262/language/types/object/S8.6.2_A5_T1.js | 33 ++++++++++ .../test262/language/types/object/S8.6.2_A5_T2.js | 33 ++++++++++ .../test262/language/types/object/S8.6.2_A5_T3.js | 32 ++++++++++ .../test262/language/types/object/S8.6.2_A5_T4.js | 33 ++++++++++ .../test262/language/types/object/S8.6.2_A6.js | 30 +++++++++ .../test262/language/types/object/S8.6.2_A7.js | 16 +++++ .../test262/language/types/object/S8.6.2_A8.js | 24 +++++++ .../test262/language/types/object/S8.6_A2_T1.js | 21 ++++++ .../test262/language/types/object/S8.6_A2_T2.js | 26 ++++++++ .../test262/language/types/object/S8.6_A3_T1.js | 20 ++++++ .../test262/language/types/object/S8.6_A3_T2.js | 26 ++++++++ .../test262/language/types/object/S8.6_A4_T1.js | 57 +++++++++++++++++ .../tests/test262/language/types/object/browser.js | 0 .../tests/test262/language/types/object/shell.js | 0 21 files changed, 605 insertions(+) create mode 100644 js/src/tests/test262/language/types/object/S8.6.1_A1.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.1_A2.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.1_A3.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A1.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A2.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A3.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A4.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A5_T1.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A5_T2.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A5_T3.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A5_T4.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A6.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A7.js create mode 100644 js/src/tests/test262/language/types/object/S8.6.2_A8.js create mode 100644 js/src/tests/test262/language/types/object/S8.6_A2_T1.js create mode 100644 js/src/tests/test262/language/types/object/S8.6_A2_T2.js create mode 100644 js/src/tests/test262/language/types/object/S8.6_A3_T1.js create mode 100644 js/src/tests/test262/language/types/object/S8.6_A3_T2.js create mode 100644 js/src/tests/test262/language/types/object/S8.6_A4_T1.js create mode 100644 js/src/tests/test262/language/types/object/browser.js create mode 100644 js/src/tests/test262/language/types/object/shell.js (limited to 'js/src/tests/test262/language/types/object') diff --git a/js/src/tests/test262/language/types/object/S8.6.1_A1.js b/js/src/tests/test262/language/types/object/S8.6.1_A1.js new file mode 100644 index 0000000000..54ecf7df5d --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.1_A1.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: A property can have attribute ReadOnly like E in Math +es5id: 8.6.1_A1 +description: Try change Math.E property +flags: [noStrict] +---*/ + +var __e = Math.E; +Math.E=1; +if (Math.E !==__e){ + throw new Test262Error('#1: __e = Math.E; Math.E=1; Math.E ===__e'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.1_A2.js b/js/src/tests/test262/language/types/object/S8.6.1_A2.js new file mode 100644 index 0000000000..cb73a76a30 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.1_A2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: A property can have attribute DontEnum like all properties of Number +es5id: 8.6.1_A2 +description: Try to enumerate properties of Number +---*/ + +//CHECK#1 +var count=0; +for (p in Number) count++; +if (count > 0){ + throw new Test262Error('#1: count=0; for (p in Number) count++; count > 0. Actual: ' + (count)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.1_A3.js b/js/src/tests/test262/language/types/object/S8.6.1_A3.js new file mode 100644 index 0000000000..af085a0cf6 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.1_A3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + A property can have attribute DontDelete like NaN propertie of Number + object +es5id: 8.6.1_A3 +description: Try to delete Number.NaN +flags: [noStrict] +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete Number.NaN !== false){ + throw new Test262Error('#1: delete Number.NaN === false. Actual: ' + (delete Number.NaN)); +}; +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (typeof(Number.NaN) === "undefined"){ + throw new Test262Error('#2: delete Number.NaN; typeof(Number.NaN) !== "undefined" '); +}; +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A1.js b/js/src/tests/test262/language/types/object/S8.6.2_A1.js new file mode 100644 index 0000000000..3ff23fca5e --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A1.js @@ -0,0 +1,74 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + Native ECMAScript objects have an internal property called [[Prototype]]. The value of this property is + either null or an object and is used for implementing inheritance +es5id: 8.6.2_A1 +description: Check [[Prototype]] property of object +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +var __obj={}; +if (!Object.prototype.isPrototypeOf(__obj)){ + throw new Test262Error('#1: Native ECMAScript objects have an internal property called [[Prototype]]. '); +}; +// +////////////////////////////////////////////////////////////////////////////// + +//Establish proto (base) object +/*function ProtoObj(){ + +};*/ +var protoObj={}; +//Establish foo object +function FooObj(){}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +// Invoke instance of foo object +var obj__= new FooObj; + +if (!Object.prototype.isPrototypeOf(obj__)){ + throw new Test262Error('#2.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; Object.prototype.isPrototypeOf(obj__) === true. Actual: ' + (Object.prototype.isPrototypeOf(obj__))); +}; + +if (!FooObj.prototype.isPrototypeOf(obj__)){ + throw new Test262Error('#2.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype.isPrototypeOf(obj__) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(obj__))); +}; + +if (protoObj.isPrototypeOf(obj__)){ + throw new Test262Error('#2.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__))); +}; +// Establish inheritance from proto object +FooObj.prototype=protoObj; + +if (protoObj.isPrototypeOf(obj__)){ + throw new Test262Error('#2.4: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; protoObj.isPrototypeOf(obj__) === false. Actual: ' + (protoObj.isPrototypeOf(obj__))); +}; +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 + +// Invoke instance of foo object +var __foo=new FooObj; + +if (!Object.prototype.isPrototypeOf(__foo)){ + throw new Test262Error('#3.1: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; Object.prototype.isPrototypeOf(__foo) === true. Actual: ' + (Object.prototype.isPrototypeOf(__foo))); +}; + +if (!FooObj.prototype.isPrototypeOf(__foo)){ + throw new Test262Error('#3.2: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; FooObj.prototype.isPrototypeOf(__foo) === true. Actual: ' + (FooObj.prototype.isPrototypeOf(__foo))); +}; + +if (!protoObj.isPrototypeOf(__foo)){ + throw new Test262Error('#3.3: protoObj={}; function FooObj(){}; var obj__= new FooObj; FooObj.prototype=protoObj; var __foo=new FooObj; protoObj.isPrototypeOf(__foo) === true. Actual: ' + (protoObj.isPrototypeOf(__foo))); +}; +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A2.js b/js/src/tests/test262/language/types/object/S8.6.2_A2.js new file mode 100644 index 0000000000..d318fc65d6 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A2.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + Properties of the [[Prototype]] object + are visible as properties of the child object for the purposes of get access, but not for put access +es5id: 8.6.2_A2 +description: > + Check visibility properties of the child object for the purposes + of get access, but not for put access +---*/ + +//Establish foo object +function FooObj(){}; +FooObj.prototype.prop="some"; + +// Invoke instance of foo object +var foo= new FooObj; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (foo.prop !== "some"){ + throw new Test262Error('#1: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop === "some". Actual: ' + (foo.prop)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +foo.prop=true; +// Invoke another instance of foo object +var foo__ = new FooObj; +if (foo__.prop !== "some"){ + throw new Test262Error('#2: function FooObj(){}; FooObj.prototype.prop="some"; var foo= new FooObj; foo.prop=true; var foo__ = new FooObj; foo__.prop === "some". Actual: ' + (foo__.prop)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A3.js b/js/src/tests/test262/language/types/object/S8.6.2_A3.js new file mode 100644 index 0000000000..cecd3cf998 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The specification does not provide any means for a program to access + [[class]] value except through Object.prototype.toString +es5id: 8.6.2_A3 +description: Get [[class]] value except through Object.prototype.toString +---*/ + +var __obj={}; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toString() !== "[object " + 'Object' + "]"){ + throw new Test262Error('#1: var __obj={}; __obj.toString() === "[object " + \'Object\' + "]". Actual: ' + (__obj.toString())); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A4.js b/js/src/tests/test262/language/types/object/S8.6.2_A4.js new file mode 100644 index 0000000000..b24ea13267 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A4.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + [[HasInstance]] returns a boolean value indicating whether Value + delegates behaviour to this object +es5id: 8.6.2_A4 +description: > + Check that the obj instance of Object, but not instance of + Function, String, Number, Array +---*/ + +var __obj={}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__obj instanceof Object)) { + throw new Test262Error('#1: var __obj={}; (__obj instanceof Object) === true. Actual: ' + ((__obj instanceof Object))); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj instanceof Function) { + throw new Test262Error('#2: var __obj={}; (__obj instanceof Function) === false. Actual: ' + ((__obj instanceof Function))); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__obj instanceof String) { + throw new Test262Error('#3: var __obj={}; (__obj instanceof String) === false. Actual: ' + ((__obj instanceof String))); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__obj instanceof Number) { + throw new Test262Error('#4: var __obj={}; (__obj instanceof Number) === false. Actual: ' + ((__obj instanceof Number))); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__obj instanceof Array) { + throw new Test262Error('#5: var __obj={}; (__obj instanceof Array) === false. Actual: ' + ((__obj instanceof Array))); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A5_T1.js b/js/src/tests/test262/language/types/object/S8.6.2_A5_T1.js new file mode 100644 index 0000000000..d30f3b0034 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A5_T1.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "[[Call]] executes code associated with the object" +es5id: 8.6.2_A5_T1 +description: > + Call function-property of object, property defined as testScreen + = {touch:function(){count++}} +---*/ + +this.count=0; + +var testScreen = {touch:function(){count++}}; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +testScreen.touch(); +if (count !==1) { + throw new Test262Error('#1: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); count === 1. Actual: ' + (count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +testScreen['touch'](); +if (count !==2) { + throw new Test262Error('#2: this.count=0; testScreen = {touch:function(){count++}}; testScreen.touch(); testScreen[\'touch\'](); count === 2. Actual: ' + (count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A5_T2.js b/js/src/tests/test262/language/types/object/S8.6.2_A5_T2.js new file mode 100644 index 0000000000..5d69d10c53 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A5_T2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "[[Call]] executes code associated with the object" +es5id: 8.6.2_A5_T2 +description: > + Call function-property of object, property defined as + seat['move']=function(){position++} +---*/ + +this.position=0; +var seat = {}; +seat['move']=function(){position++}; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +seat.move(); +if (position !==1) { + throw new Test262Error('#1: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); position === 1. Actual: ' + (position)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +seat['move'](); +if (position !==2) { + throw new Test262Error('#2: this.position=0; seat = {}; seat[\'move\']=function(){position++}; seat.move(); seat[\'move\'](); position === 2. Actual: ' + (position)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A5_T3.js b/js/src/tests/test262/language/types/object/S8.6.2_A5_T3.js new file mode 100644 index 0000000000..f1d8a6ee01 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A5_T3.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "[[Call]] executes code associated with the object" +es5id: 8.6.2_A5_T3 +description: > + Call function-property of global object, property defined as + knock=function(){count++} +---*/ + +var count=0; +var knock=function(){count++}; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +knock(); +if (count !==1) { + throw new Test262Error('#1: count=0; knock=function(){count++}; knock(); count === 1. Actual: ' + (count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +this['knock'](); +if (count !==2) { + throw new Test262Error('#2: count=0; knock=function(){count++}; knock(); this[\'knock\'](); count === 2. Actual: ' + (count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A5_T4.js b/js/src/tests/test262/language/types/object/S8.6.2_A5_T4.js new file mode 100644 index 0000000000..fb26cb9ec5 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A5_T4.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "[[Call]] executes code associated with the object" +es5id: 8.6.2_A5_T4 +description: > + Call function-property of global object, property defined as + this['beep']=function(){__count++} +---*/ + +var __count=0; + +this["beep"]=function(){__count++}; +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +beep(); +if (__count !==1) { + throw new Test262Error('#1: __count=0; this["beep"]=function(){__count++}; beep(); __count === 1. Actual: ' + (__count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +this["beep"](); +if (__count !==2) { + throw new Test262Error('#2: __count=0; this["beep"]=function(){__count++}; beep(); this["beep"](); __count === 2. Actual: ' + (__count)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A6.js b/js/src/tests/test262/language/types/object/S8.6.2_A6.js new file mode 100644 index 0000000000..b6f729d70f --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A6.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + [[Construct]] constructs an object. Invoked via the new operator. Objects + that implement this internal method are called constructors +es5id: 8.6.2_A6 +description: Create a few Objects via the new operator +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +var objInstance=new Object; +if (objInstance.constructor !== Object){ + throw new Test262Error('#1: var objInstance=new Object; objInstance.constructor === Object. Actual: ' + (objInstance.constructor)); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +var numInstance=new Number; +if (numInstance.constructor !== Number){ + throw new Test262Error('#2: var numInstance=new Number; numInstance.constructor === Number. Actual: ' + (numInstance.constructor)); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A7.js b/js/src/tests/test262/language/types/object/S8.6.2_A7.js new file mode 100644 index 0000000000..32ded83824 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A7.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + Objects that implement internal method [[Construct]] are called + constructors. Math object is NOT constructor +es5id: 8.6.2_A7 +description: Checking if execution of "var objMath=new Math" passes +---*/ + +assert.throws(TypeError, function() { + var objMath=new Math; +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6.2_A8.js b/js/src/tests/test262/language/types/object/S8.6.2_A8.js new file mode 100644 index 0000000000..2f93fedb2b --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6.2_A8.js @@ -0,0 +1,24 @@ +// Copyright 2011 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 8.6.2_A8 +description: > + It should not be possible to change the [[Prototype]] of a + non-extensible object +---*/ + +var x = Object.preventExtensions({}); +var y = {}; +try { + x.__proto__ = y; +} catch (err) { + // As far as this test is concerned, we allow the above assignment + // to fail. This failure does violate the spec and should probably + // be tested separately. +} +if (Object.getPrototypeOf(x) !== Object.prototype) { + throw new Test262Error("Prototype of non-extensible object mutated"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6_A2_T1.js b/js/src/tests/test262/language/types/object/S8.6_A2_T1.js new file mode 100644 index 0000000000..1871f0f435 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6_A2_T1.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Do not crash with postincrement custom property +es5id: 8.6_A2_T1 +description: Try to implement postincrement for custom property +---*/ + +var __map={foo:"bar"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 + +__map.foo++; +assert.sameValue(__map.foo, NaN); + +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6_A2_T2.js b/js/src/tests/test262/language/types/object/S8.6_A2_T2.js new file mode 100644 index 0000000000..74ccd45349 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6_A2_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Do not crash with postincrement custom property +es5id: 8.6_A2_T2 +description: Try to implement postincrement for not declared custom property +---*/ + +var __map={}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +assert.sameValue(__map.foo++, NaN); +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!("foo" in __map)) { + throw new Test262Error('#2: var __map={}; "foo" in __map'); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6_A3_T1.js b/js/src/tests/test262/language/types/object/S8.6_A3_T1.js new file mode 100644 index 0000000000..61a1275f26 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6_A3_T1.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Do not crash with pefixincrement custom property +es5id: 8.6_A3_T1 +description: Try to implement pefixincrement for custom property +---*/ + +var __map={foo:'bar'}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 + +++__map.foo; +assert.sameValue(__map.foo, NaN); +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6_A3_T2.js b/js/src/tests/test262/language/types/object/S8.6_A3_T2.js new file mode 100644 index 0000000000..6bf72e8413 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6_A3_T2.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Do not crash with pefixincrement custom property +es5id: 8.6_A3_T2 +description: Try to implement pefixincrement for not declared custom property +---*/ + +var __map={}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +assert.sameValue(++__map.foo, NaN, "++__map.foo"); +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!("foo" in __map)) { + throw new Test262Error('#2: var __map={}; "foo" in __map'); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/S8.6_A4_T1.js b/js/src/tests/test262/language/types/object/S8.6_A4_T1.js new file mode 100644 index 0000000000..1e311e2153 --- /dev/null +++ b/js/src/tests/test262/language/types/object/S8.6_A4_T1.js @@ -0,0 +1,57 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: An Object is an unordered collection of properties +es5id: 8.6_A4_T1 +description: Simple using a few custom properties +---*/ + +/////////////////////////////////////////////////////// +// CHECK#1 +var obj = {bar:true, some:1, foo:"a"}; + +var count=0; + +for (var property in obj) count++; + +if (count !== 3){ + throw new Test262Error('#1: obj = {bar:true, some:1, foo:"a"}; count=0; for (property in obj) count++; count === 3. Actual: ' + (count)); +} +// +//////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////// +// CHECK#2 +var obj_ = {bar:true}; +obj_.some = 1; +obj_.foo = "a"; + +count=0; + +for (property in obj_) count++; + +if (count !== 3){ + throw new Test262Error('#2: obj_ = {bar:true}; obj_.some = 1; obj_.foo = "a"; count=0; for (property in obj_) count++; count === 3. Actual: ' + (count)); +} +// +//////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////// +// CHECK#3 +var obj__ = new Object(); +obj__.bar = true; +obj__.some = 1; +obj__.foo = "a"; + +count=0; + +for (property in obj__) count++; + +if (count !== 3){ + throw new Test262Error('#3: obj__ = new Object(); obj__.bar = true; obj__.some = 1; obj__.foo = "a"; for (property in obj__) count++; count === 3. Actual: ' + (count)); +} +// +//////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/object/browser.js b/js/src/tests/test262/language/types/object/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/language/types/object/shell.js b/js/src/tests/test262/language/types/object/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3