mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Subject:
[Fwd: My Mistake in ScriptRuntime method]]] Date: Tue, 16 Jan 2001 15:48:26 +0100 From: Igor Bukanov <igor@icesoft.no> To: Norris Boyd <nboyd@atg.com> Hi, Norris! With my previous patch to fix in org/mozilla/javascript/ScriptRuntime.java Integer.MIN_VALUE as index problem I also added a bug to the unrelated code: I tried to minimize object creation and unfortunately that untested "optimization" slippet into my patch as well. I replaced the lines 290, 291 in toNumber(String s) method from String sub = s.substring(start, end+1); if (sub.equals("Infinity")) to if (s.regionMatches(start, "Infinity", 0, 8)) But that should be if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8)) Sory for troubles, Igor 290c290 < if (s.regionMatches(start, "Infinity", 0, 8)) --- > if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8))
This commit is contained in:
parent
86b8efd7cb
commit
08a188c69b
@ -287,7 +287,7 @@ public class ScriptRuntime {
|
||||
// check for "Infinity"
|
||||
if (startChar == '+' || startChar == '-')
|
||||
start++;
|
||||
if (s.regionMatches(start, "Infinity", 0, 8))
|
||||
if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8))
|
||||
return startChar == '-'
|
||||
? Double.NEGATIVE_INFINITY
|
||||
: Double.POSITIVE_INFINITY;
|
||||
|
@ -287,7 +287,7 @@ public class ScriptRuntime {
|
||||
// check for "Infinity"
|
||||
if (startChar == '+' || startChar == '-')
|
||||
start++;
|
||||
if (s.regionMatches(start, "Infinity", 0, 8))
|
||||
if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8))
|
||||
return startChar == '-'
|
||||
? Double.NEGATIVE_INFINITY
|
||||
: Double.POSITIVE_INFINITY;
|
||||
|
Loading…
Reference in New Issue
Block a user