diff options
Diffstat (limited to 'test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js')
-rw-r--r-- | test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js b/test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js index 97ab2def6..d40f319ce 100644 --- a/test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js +++ b/test/built-ins/String/prototype/indexOf/S15.5.4.7_A4_T5.js @@ -11,9 +11,20 @@ description: > throw exception ---*/ -var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}}; +var __obj = { + toString: function() { + return {}; + }, + valueOf: function() { + throw "intostr"; + } +}; -var __obj2 = {valueOf:function(){throw "intointeger";}}; +var __obj2 = { + valueOf: function() { + throw "intointeger"; + } +}; __FACTORY.prototype.indexOf = String.prototype.indexOf; @@ -25,15 +36,19 @@ try { var x = __instance.indexOf(__obj, __obj2); $ERROR('#1: "var x = __instance.indexOf(__obj, __obj2)" lead to throwing exception'); } catch (e) { - if (e!=="intostr") { - $ERROR('#1.1: Exception === "intostr". Actual: '+e); + if (e !== "intostr") { + $ERROR('#1.1: Exception === "intostr". Actual: ' + e); } } // ////////////////////////////////////////////////////////////////////////////// -function __FACTORY( value ) { - this.value = value; - this.toString = function() { return new Number; }; - this.valueOf=function(){return this.value+""}; +function __FACTORY(value) { + this.value = value; + this.toString = function() { + return new Number; + }; + this.valueOf = function() { + return this.value + "" + }; } |