From c1f0f4a7a79d8ab1d942f86146a50ae8fb83eb31 Mon Sep 17 00:00:00 2001 From: "armin@diedering.de" Date: Mon, 2 Jan 2012 22:43:17 +0000 Subject: [PATCH] 42tiny-js: changed: test019.42.js because Integer.parseInt is moved in r70 to the global scope. with the next commit the Integer-object will be completely removed from 42tiny-js. "Integer.valueOf" can no longer be used. Uses "String.charCodeAt" instead. --- tests/test019.42.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test019.42.js b/tests/test019.42.js index d2caa6f..5d8856a 100644 --- a/tests/test019.42.js +++ b/tests/test019.42.js @@ -7,7 +7,11 @@ foo = "foo bar stuff"; r = Math.random(); //<--- 42-tiny-js change end -parsed = Integer.parseInt("42"); +// 42-tiny-js change begin ---> +// in JavaScript parseInt is a methode in the global scope (root-scope) +//parsed = Integer.parseInt("42"); +parsed = parseInt("42"); +//<--- 42-tiny-js change end aStr = "ABCD"; aChar = aStr.charAt(0); @@ -19,5 +23,10 @@ obj1.desert = "pie"; obj2 = obj1.clone(); obj2.food = "kittens"; -result = foo.length==13 && foo.indexOf("bar")==4 && foo.substring(8,13)=="stuff" && parsed==42 && - Integer.valueOf(aChar)==65 && obj1.food=="cake" && obj2.desert=="pie"; +result = foo.length==13 && foo.indexOf("bar")==4 && foo.substring(8,13)=="stuff" && parsed==42 && +// 42-tiny-js change begin ---> +// in 42tiny-js the Integer-Objecte will be removed +// Integer.valueOf can be replaced by String.charCodeAt +// Integer.valueOf(aChar)==65 && obj1.food=="cake" && obj2.desert=="pie"; + aChar.charCodeAt()==65 && obj1.food=="cake" && obj2.desert=="pie"; +//<--- 42-tiny-js change end