diff --git a/test/built-ins/Function/prototype/S15.3.4_A5.js b/test/built-ins/Function/prototype/S15.3.4_A5.js index e691fb2f89330e9fa9f3e6b534bd09f6c9b83a58..49886228fdaf50d771d8378d4d6d172e8455bf9b 100644 --- a/test/built-ins/Function/prototype/S15.3.4_A5.js +++ b/test/built-ins/Function/prototype/S15.3.4_A5.js @@ -7,15 +7,8 @@ info: > [[Construct]] property es5id: 15.3.4_A5 description: Checking if creating "new Function.prototype object" fails -includes: - - $PRINT.js ---*/ -//CHECK# -try { - var obj = new Function.prototype; - $ERROR('#1: The Function prototype object is itself a Function object without [[Construct]] property: '+e); -} catch (e) { - $PRINT("#1.1: The Function prototype object is itself a Function object without [[Construct]] property "+e); - -} +assert.throws(TypeError, function() { + new Function.prototype; +}); diff --git a/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js b/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js index c6d46fcae205f0635a37081593773adf772da3a2..ef8ce2695989c2bd408467449c2fe1dd01bd38a1 100644 --- a/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js +++ b/test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js @@ -5,15 +5,10 @@ info: Function.prototype.toString can't be used as constructor es5id: 15.3.4.2_A7 description: Checking if creating "new Function.prototype.toString" fails -includes: - - $PRINT.js ---*/ var FACTORY = Function.prototype.toString; -try { - var instance = new FACTORY; - $ERROR('#1: Function.prototype.toString can\'t be used as constructor'); -} catch (e) { - $PRINT(e); -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/S15.2.4_A3.js b/test/built-ins/Object/prototype/S15.2.4_A3.js index 4f8f3bad8fbd9f9fea09854f39c71593a7e17352..3afac8afb533a6f75f54bdc179cc001b1ccf3ed2 100644 --- a/test/built-ins/Object/prototype/S15.2.4_A3.js +++ b/test/built-ins/Object/prototype/S15.2.4_A3.js @@ -7,14 +7,8 @@ info: > method es5id: 15.2.4_A3 description: Checking if calling Object prototype as a function fails -includes: - - $PRINT.js ---*/ -//CHECK#1 -try { +assert.throws(TypeError, function() { Object.prototype(); - $ERROR('#1: Since Object prototype object is not function it has not [[call]] method'); -} catch (e) { - $PRINT(e); -} +}); diff --git a/test/built-ins/Object/prototype/S15.2.4_A4.js b/test/built-ins/Object/prototype/S15.2.4_A4.js index 8cff6c8f43daa09fb910cf9bca42c73d4e0e40b6..3f575d5fa3bd4ceb82e8a283aaeb9896f8b5a353 100644 --- a/test/built-ins/Object/prototype/S15.2.4_A4.js +++ b/test/built-ins/Object/prototype/S15.2.4_A4.js @@ -7,14 +7,8 @@ info: > [[create]] method es5id: 15.2.4_A4 description: Checking if creating "new Object.prototype" fails -includes: - - $PRINT.js ---*/ -//CHECK#1 -try { - var instance = new Object.prototype; - $ERROR('#1: Since Object prototype object is not function it has not [[create]] method'); -} catch (e) { - $PRINT(e); -} +assert.throws(TypeError, function() { + new Object.prototype; +}); diff --git a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js b/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js index 228b00b07c148eb64e822c3214ae7b6a1256714f..a6480454eb196d67618eb7ba44c92fad7f7513ed 100644 --- a/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js +++ b/test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js @@ -11,10 +11,6 @@ includes: var FACTORY = Object.prototype.hasOwnProperty; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.hasOwnProperty can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); - -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A7.js b/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A7.js index 410f91bb6478847360749180720bcef8d3a3936c..5e9bf6d46fe40b69f4cbb0d25c2c3000e53c62d3 100644 --- a/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A7.js +++ b/test/built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A7.js @@ -5,16 +5,10 @@ info: Object.prototype.isPrototypeOf can't be used as a constructor es5id: 15.2.4.6_A7 description: Checking if creating new "Object.prototype.isPrototypeOf" fails -includes: - - $PRINT.js ---*/ var FACTORY = Object.prototype.isPrototypeOf; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.isPrototypeOf can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); - -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js b/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js index 34821898f3a2a9c9408ff1d0b6b620cf6be167f0..98ac74a1236870efecce021fb3571a17dc018479 100644 --- a/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js +++ b/test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js @@ -7,16 +7,10 @@ es5id: 15.2.4.7_A7 description: > Checking if creating "new Object.prototype.propertyIsEnumerable" fails -includes: - - $PRINT.js ---*/ var FACTORY = Object.prototype.propertyIsEnumerable; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.propertyIsEnumerable can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); - -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js b/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js index 5567a3fb802016ae5f8dd33e28a5e90ab5c2b763..b186512351d29c8de488ea4c95ac6c23e1c2d987 100644 --- a/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js +++ b/test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js @@ -5,16 +5,10 @@ info: Object.prototype.toLocaleString can't be used as a constructor es5id: 15.2.4.3_A7 description: Checking if creating "new Object.prototype.toLocaleString" fails -includes: - - $PRINT.js ---*/ var FACTORY = Object.prototype.toLocaleString; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.toLocaleString can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); - -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/toString/S15.2.4.2_A7.js b/test/built-ins/Object/prototype/toString/S15.2.4.2_A7.js index ea58f028ecccbe8d0218cfaeec5783b2980b4afc..99e331d7d9e5a454647b4299d6ea4755ff38d028 100644 --- a/test/built-ins/Object/prototype/toString/S15.2.4.2_A7.js +++ b/test/built-ins/Object/prototype/toString/S15.2.4.2_A7.js @@ -5,15 +5,10 @@ info: Object.prototype.toString can't be used as a constructor es5id: 15.2.4.2_A7 description: Checking if creating "new Object.prototype.toString" fails -includes: - - $PRINT.js ---*/ var FACTORY = Object.prototype.toString; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.toString can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js b/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js index 902fa142a8f5550a01caeb9e5f0b5b661ef3f501..44490329c7d924d52e2e3af9a7819512c5f2aa17 100644 --- a/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js +++ b/test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js @@ -11,10 +11,6 @@ includes: var FACTORY = Object.prototype.valueOf; -try { - var instance = new FACTORY; - $ERROR('#1: Object.prototype.valueOf can\'t be used as a constructor'); -} catch (e) { - $PRINT(e); - -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A7.js b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A7.js index a9e1972280f980409d74275b07b9183b322e6b8f..40a0c4941fe7b10b290fd6db3d7143ff06407475 100644 --- a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A7.js +++ b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A7.js @@ -5,15 +5,10 @@ info: String.prototype.lastIndexOf can't be used as constructor es5id: 15.5.4.8_A7 description: Checking if creating the String.prototype.lastIndexOf object fails -includes: - - $PRINT.js ---*/ -var __FACTORY = String.prototype.lastIndexOf; +var FACTORY = String.prototype.lastIndexOf; -try { - var __instance = new __FACTORY; - $ERROR('#1: __FACTORY = String.prototype.lastIndexOf; __instance = new __FACTORY lead to throwing exception'); -} catch (e) { - $PRINT(e); -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/built-ins/String/prototype/slice/S15.5.4.13_A7.js b/test/built-ins/String/prototype/slice/S15.5.4.13_A7.js index 7246b6d8f07cc79741252cae3e1ef50f8726d4d0..deba84f20ff018833a0de26d1a84d6ff0c347947 100644 --- a/test/built-ins/String/prototype/slice/S15.5.4.13_A7.js +++ b/test/built-ins/String/prototype/slice/S15.5.4.13_A7.js @@ -5,15 +5,10 @@ info: String.prototype.slice can't be used as constructor es5id: 15.5.4.13_A7 description: Checking if creating the String.prototype.slice object fails -includes: - - $PRINT.js ---*/ -var __FACTORY = String.prototype.slice; +var FACTORY = String.prototype.slice; -try { - var __instance = new __FACTORY; - $ERROR('#1: __FACTORY = String.prototype.slice; "__instance = new __FACTORY" lead to throwing exception'); -} catch (e) { - $PRINT(e); -} +assert.throws(TypeError, function() { + new FACTORY; +}); diff --git a/test/language/statements/block/S12.1_A2.js b/test/language/statements/block/S12.1_A2.js index eda09af2c4b83d488dedd52e8c8b973137ee3a8e..7b3cf0d3969789fb23d4cd8032a8e678b98c3760 100644 --- a/test/language/statements/block/S12.1_A2.js +++ b/test/language/statements/block/S12.1_A2.js @@ -13,12 +13,12 @@ includes: [$PRINT.js] ////////////////////////////////////////////////////////////////////////////// //CHECK#1 -try { - x(); - $ERROR('#1: "x()" lead to throwing exception'); -} catch (e) { - $PRINT(e.message); -} +assert.throws(ReferenceError, function() { + { + x(); + } +}); + // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/language/statements/variable/S12.2_A1.js b/test/language/statements/variable/S12.2_A1.js index 76bf477558998f5d45d1d112854b05dba9cbab83..1a53da06644a7bdc4533c10aae7f5b35e2511df6 100644 --- a/test/language/statements/variable/S12.2_A1.js +++ b/test/language/statements/variable/S12.2_A1.js @@ -8,7 +8,6 @@ info: > VariableStatement is executed, not when the variable is created es5id: 12.2_A1 description: Creating variables after entering the execution scope -includes: [$PRINT.js] ---*/ ////////////////////////////////////////////////////////////////////////////// @@ -25,12 +24,9 @@ try { ////////////////////////////////////////////////////////////////////////////// //CHECK#2 -try{ +assert.throws(ReferenceError, function() { __something__undefined = __something__undefined; - $ERROR('#2: "__something__undefined = __something__undefined" lead to throwing exception'); -} catch(e){ - $PRINT(e.message); -} +}); // ////////////////////////////////////////////////////////////////////////////// diff --git a/test/language/statements/variable/S12.2_A5.js b/test/language/statements/variable/S12.2_A5.js index 877b9c72879accbbdbe084754635916b236359c0..6a0de73113b1622cdb175ceaf94fe13c56bdaee2 100644 --- a/test/language/statements/variable/S12.2_A5.js +++ b/test/language/statements/variable/S12.2_A5.js @@ -7,18 +7,14 @@ info: > reaches the eval statement es5id: 12.2_A5 description: Executing eval("var x") -includes: [$PRINT.js] flags: [noStrict] ---*/ ////////////////////////////////////////////////////////////////////////////// //CHECK#1 -try{ +assert.throws(ReferenceError, function() { x=x; - $ERROR('#1: "x=x" lead to throwing exception'); -}catch(e){ - $PRINT(e.message); -}; +}); // //////////////////////////////////////////////////////////////////////////////