[minijoe] r75 committed - - String.split() wasn't exposed....

1 view
Skip to first unread message

min...@googlecode.com

unread,
Jul 25, 2010, 9:51:20 AM7/25/10
to min...@googlegroups.com
Revision: 75
Author: orientalsensation
Date: Sun Jul 25 06:50:37 2010
Log: - String.split() wasn't exposed.
- 2nd parameter to split() is optional, this wasn't being considered.
- limit variable defaulted to Integer.MAX_VALUE instead of Double.MAX_VALUE
http://code.google.com/p/minijoe/source/detail?r=75

Modified:
/trunk/src/com/google/minijoe/sys/JsObject.java

=======================================
--- /trunk/src/com/google/minijoe/sys/JsObject.java Fri Jul 23 15:45:34 2010
+++ /trunk/src/com/google/minijoe/sys/JsObject.java Sun Jul 25 06:50:37 2010
@@ -195,6 +195,7 @@
.addVar("replace", new JsFunction(ID_REPLACE, 2))
.addVar("search", new JsFunction(ID_SEARCH, 1))
.addVar("slice", new JsFunction(ID_SLICE, 2))
+ .addVar("split", new JsFunction(ID_SPLIT, 2))
.addVar("substring", new JsFunction(ID_SUBSTRING, 2))
.addVar("toLowerCase", new JsFunction(ID_TO_LOWER_CASE, 0))
.addVar("toLocaleLowerCase", new JsFunction(ID_TO_LOCALE_LOWER_CASE,
0))
@@ -831,8 +832,8 @@
s = stack.getString(sp);
String sep = stack.getString(sp + 2);
double limit = stack.getNumber(sp + 3);
- if (Double.isNaN(limit)) {
- limit = Integer.MAX_VALUE;
+ if (Double.isNaN(limit) || limit < 1) {
+ limit = Double.MAX_VALUE;
}

JsArray a = new JsArray();

Reply all
Reply to author
Forward
0 new messages