summaryrefslogtreecommitdiff
path: root/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js')
-rw-r--r--test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js31
1 files changed, 23 insertions, 8 deletions
diff --git a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js
index 08f5fed5b..b1ea6070f 100644
--- a/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_A4_T5.js
+++ b/test/built-ins/String/prototype/lastIndexOf/S15.5.4.8_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.lastIndexOf = String.prototype.lastIndexOf;
@@ -25,15 +36,19 @@ try {
var x = __instance.lastIndexOf(__obj, __obj2);
$ERROR('#1: var x = __instance.lastIndexOf(__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 + ""
+ };
}