diff options
Diffstat (limited to 'test/built-ins/Date/S15.9.3.1_A4_T2.js')
-rw-r--r-- | test/built-ins/Date/S15.9.3.1_A4_T2.js | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/test/built-ins/Date/S15.9.3.1_A4_T2.js b/test/built-ins/Date/S15.9.3.1_A4_T2.js index bc3fc2503..3dbe78ff7 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T2.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T2.js @@ -17,45 +17,41 @@ es5id: 15.9.3.1_A4_T2 description: 3 arguments, (year, month, date) ---*/ -var myObj = function(val) { +var myObj = function(val){ this.value = val; - this.valueOf = function() { - throw "valueOf-" + this.value; - }; - this.toString = function() { - throw "toString-" + this.value; - }; + this.valueOf = function(){throw "valueOf-"+this.value;}; + this.toString = function(){throw "toString-"+this.value;}; }; //CHECK#1 -try { +try{ var x1 = new Date(new myObj(1), new myObj(2), new myObj(3)); $ERROR("#1: The 1st step is calling ToNumber(year)"); } -catch (e) { - if (e !== "valueOf-1") { +catch(e){ + if(e !== "valueOf-1"){ $ERROR("#1: The 1st step is calling ToNumber(year)"); } } //CHECK#2 -try { +try{ var x2 = new Date(1, new myObj(2), new myObj(3)); $ERROR("#2: The 2nd step is calling ToNumber(month)"); } -catch (e) { - if (e !== "valueOf-2") { +catch(e){ + if(e !== "valueOf-2"){ $ERROR("#2: The 2nd step is calling ToNumber(month)"); } } //CHECK#3 -try { +try{ var x3 = new Date(1, 2, new myObj(3)); $ERROR("#3: The 3rd step is calling ToNumber(date)"); } -catch (e) { - if (e !== "valueOf-3") { +catch(e){ + if(e !== "valueOf-3"){ $ERROR("#3: The 3rd step is calling ToNumber(date)"); } } |