diff options
Diffstat (limited to 'js/src/tests/test262/ch11/11.2/11.2.3')
22 files changed, 596 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_1.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_1.js new file mode 100644 index 000000000..8ae5b5e84 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_1.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_1.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionDeclaration)
+ */
+
+
+function testcase() {
+ var fooCalled = false;
+ function foo(){ fooCalled = true; }
+
+ var o = { };
+ try {
+ o.bar( foo() );
+ throw new Exception("o.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===true);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_2.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_2.js new file mode 100644 index 000000000..5e7496d51 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_2.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_2.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionExpression)
+ */
+
+
+function testcase() {
+ var fooCalled = false;
+ var foo = function (){ fooCalled = true; }
+
+ var o = { };
+ try {
+ o.bar( foo() );
+ throw new Exception("o.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===true);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_3.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_3.js new file mode 100644 index 000000000..04616e5a0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_3.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_3.js
+ * @description Call arguments are not evaluated before the check is made to see if the object is actually callable (undefined member)
+ */
+
+
+function testcase() {
+ var fooCalled = false;
+ function foo(){ fooCalled = true; }
+
+ var o = { };
+ try {
+ o.bar.gar( foo() );
+ throw new Exception("o.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===false);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_4.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_4.js new file mode 100644 index 000000000..f6970fa79 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_4.js @@ -0,0 +1,26 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_4.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (property)
+ */
+
+
+function testcase() {
+ var fooCalled = false;
+ function foo(){ fooCalled = true; }
+
+ var o = { };
+ Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
+ set: function(x) {this.barSetter = true; }});
+ try {
+ o.bar( foo() );
+ throw new Exception("o.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_5.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_5.js new file mode 100644 index 000000000..3e2315f03 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_5.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_5.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (eval'ed)
+ */
+
+
+function testcase() {
+ var fooCalled = false;
+ function foo(){ fooCalled = true; }
+
+ var o = { };
+ try {
+ eval("o.bar( foo() );");
+ throw new Exception("o.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===true);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_6.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_6.js new file mode 100644 index 000000000..c2bfcc45a --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_6.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_6.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called)
+ */
+
+
+function testcase() {
+ var o = { };
+ Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
+ set: function(x) {this.barSetter = true; }});
+ try {
+ o.foo( o.bar );
+ throw new Exception("o.foo does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_7.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_7.js new file mode 100644 index 000000000..2c320e778 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_7.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_7.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called as indexed property)
+ */
+
+
+function testcase() {
+ var o = { };
+ Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;},
+ set: function(x) {this.barSetter = true; }});
+ try {
+ o.foo( o["bar"] );
+ throw new Exception("o.foo does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_8.js b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_8.js new file mode 100644 index 000000000..67e5b9b80 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/11.2.3-3_8.js @@ -0,0 +1,27 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.2/11.2.3/11.2.3-3_8.js
+ * @description Call arguments are evaluated before the check is made to see if the object is actually callable (global object)
+ */
+
+
+function testcase() {
+ if (this!==fnGlobalObject()) {
+ return;
+ }
+
+ var fooCalled = false;
+ function foo(){ fooCalled = true; }
+
+ try {
+ this.bar( foo() );
+ throw new Exception("this.bar does not exist!");
+ } catch(e) {
+ return (e instanceof TypeError) && (fooCalled===true);
+ }
+}
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A1.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A1.js new file mode 100644 index 000000000..19dfdce73 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between MemberExpression and Arguments are allowed + * + * @path ch11/11.2/11.2.3/S11.2.3_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("Number\u0009()") !== 0) { + $ERROR('#1: Number\\u0009() === 0'); +} + +//CHECK#2 +if (eval("Number\u000B()") !== 0) { + $ERROR('#2: Number\\u000B() === 0'); +} + +//CHECK#3 +if (eval("Number\u000C()") !== 0) { + $ERROR('#3: Number\\u000C() === 0'); +} + +//CHECK#4 +if (eval("Number\u0020()") !== 0) { + $ERROR('#4: Number\\u0020 === 0'); +} + +//CHECK#5 +if (eval("Number\u00A0()") !== 0) { + $ERROR('#5: Number\\u00A0() === 0'); +} + +//CHECK#6 +if (eval("Number\u000A()") !== 0) { + $ERROR('#6: Number\\u000A() === 0'); +} + +//CHECK#7 +if (eval("Number\u000D()") !== 0) { + $ERROR('#7: Number\\u000D() === 0'); +} + +//CHECK#8 +if (eval("Number\u2028()") !== 0) { + $ERROR('#8: Number\\u2028() === 0'); +} + +//CHECK#9 +if (eval("Number\u2029()") !== 0) { + $ERROR('#9: Number\\u2029() === 0'); +} + +//CHECK#10 +if (eval("Number\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029()") !== 0) { + $ERROR('#10: Number\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029() === 0'); +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A2.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A2.js new file mode 100644 index 000000000..29ae4a55a --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A2.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. + +/** + * CallExpression : MemberExpression Arguments uses GetValue + * + * @path ch11/11.2/11.2.3/S11.2.3_A2.js + * @description If GetBase(MemberExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + x(); + $ERROR('#1.1: x() throw ReferenceError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: x() throw ReferenceError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + x(1,2,3); + $ERROR('#2.1: x(1,2,3) throw ReferenceError. Actual: ' + (x(1,2,3))); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#2.2: x(1,2,3) throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T1.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T1.js new file mode 100644 index 000000000..5fbf7b68d --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_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. + +/** + * If MemberExpression is not Object, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A3_T1.js + * @description Checking "boolean primitive" case + */ + +//CHECK#1 +try { + true(); + $ERROR('#1.1: true() throw TypeError. Actual: ' + (true())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: true() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = true; + x(); + $ERROR('#2.1: var x = true; x() throw TypeError. Actual: ' + (x())) +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = true; x() throw TypeError. Actual: ' + (e)) + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T2.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T2.js new file mode 100644 index 000000000..253f1b0e6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_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. + +/** + * If MemberExpression is not Object, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A3_T2.js + * @description Checking "number primitive" case + */ + +//CHECK#1 +try { + 1(); + $ERROR('#1.1: 1() throw TypeError. Actual: ' + (1())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: 1() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = 1; + x(); + $ERROR('#2.1: var x = 1; x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = 1; x() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T3.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T3.js new file mode 100644 index 000000000..388510f21 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T3.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. + +/** + * If MemberExpression is not Object, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A3_T3.js + * @description Checking "string primitive" case + */ + +//CHECK#1 +try { + "1"(); + $ERROR('#1.1: "1"() throw TypeError. Actual: ' + ("1"())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: "1"() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = "1"; + x(); + $ERROR('#2.1: var x = "1"; x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = "1"; x() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T4.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T4.js new file mode 100644 index 000000000..a167260ed --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_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. + +/** + * If MemberExpression is not Object, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A3_T4.js + * @description Checking "undefined" case + */ + +//CHECK#1 +try { + undefined(); + $ERROR('#1.1: undefined() throw TypeError. Actual: ' + (e)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: undefined() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = undefined; + x(); + $ERROR('#2.1: var x = undefined; x() throw TypeError. Actual: ' + (e)); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = undefined; x() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T5.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T5.js new file mode 100644 index 000000000..77cd76fa4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A3_T5.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. + +/** + * If MemberExpression is not Object, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A3_T5.js + * @description Checking "null" case + */ + +//CHECK#1 +try { + null(); + $ERROR('#1.1: null() throw TypeError. Actual: ' + (null())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: null() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = null; + x(); + $ERROR('#2.1: var x = null; x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = null; x() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T1.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T1.js new file mode 100644 index 000000000..ca028fa5a --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If MemberExpression does not implement the internal [[Call]] method, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A4_T1.js + * @description Checking Boolean object case + */ + +//CHECK#1 +try { + new Boolean(true)(); + $ERROR('#1.1: new Boolean(true)() throw TypeError. Actual: ' + (new Boolean(true)())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Boolean(true)() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = new Boolean(true); + x(); + $ERROR('#2.1: var x = new Boolean(true); x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = new Boolean(true); x() throw TypeError. Actual: ' + (e)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T2.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T2.js new file mode 100644 index 000000000..41f898305 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T2.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If MemberExpression does not implement the internal [[Call]] method, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A4_T2.js + * @description Checking Number object case + */ + +//CHECK#1 +try { + new Number(1)(); + $ERROR('#1.1: new Number(1)() throw TypeError. Actual: ' + (new Number(1)())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new Number(1)() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = new Number(1); + x(); + $ERROR('#2.1: var x = new Number(1); x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = new Number(1); x() throw TypeError. Actual: ' + (e)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T3.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T3.js new file mode 100644 index 000000000..108085425 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T3.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. + +/** + * If MemberExpression does not implement the internal [[Call]] method, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A4_T3.js + * @description Checking String object case + */ + +//CHECK#1 +try { + new String("1")(); + $ERROR('#1.1: new String("1")() throw TypeError. Actual: ' + (new String("1")())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new String("1")() throw TypeError. Actual: ' + (e)); + } +} + +//CHECK#2 +try { + var x = new String("1"); + x(); + $ERROR('#2.1: var x = new String("1"); x() throw TypeError. Actual: ' + (x())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2.2: var x = new String("1"); x() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T4.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T4.js new file mode 100644 index 000000000..a19cc05e6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T4.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. + +/** + * If MemberExpression does not implement the internal [[Call]] method, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A4_T4.js + * @description Checking Global object case + */ + +//CHECK#1 +try { + this(); + $ERROR('#1.1: this() throw TypeError. Actual: ' + (this())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: this() throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T5.js b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T5.js new file mode 100644 index 000000000..ddaf40c8d --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/S11.2.3_A4_T5.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If MemberExpression does not implement the internal [[Call]] method, throw TypeError + * + * @path ch11/11.2/11.2.3/S11.2.3_A4_T5.js + * @description Checking Math object case + */ + +//CHECK#1 +try { + Math(); + $ERROR('#1.1: Math() throw TypeError. Actual: ' + (Math())); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: Math() throw TypeError. Actual: ' + (e)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/browser.js b/js/src/tests/test262/ch11/11.2/11.2.3/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/browser.js diff --git a/js/src/tests/test262/ch11/11.2/11.2.3/shell.js b/js/src/tests/test262/ch11/11.2/11.2.3/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.2/11.2.3/shell.js |