2011-09-19 Gavin Barraclough <barraclough@apple.com>
+ Errrk, missed stylebot comments in last commit.
+
+ * runtime/StringPrototype.cpp:
+ (JSC::stringProtoFuncSplit):
+
+2011-09-19 Gavin Barraclough <barraclough@apple.com>
+
String#split is buggy
https://bugs.webkit.org/show_bug.cgi?id=68348
// 10. If separator is undefined, then
if (separatorValue.isUndefined()) {
- // a. Call the [[DefineOwnProperty]] internal method of A with arguments "0",
- // Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
+ // a. Call the [[DefineOwnProperty]] internal method of A with arguments "0",
+ // Property Descriptor {[[Value]]: S, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}, and false.
result->put(exec, 0, jsStringWithReuse(exec, thisValue, input));
- // b. Return A.
+ // b. Return A.
return JSValue::encode(result);
}
// Zero limt/input length handled in steps 9/11 respectively, above.
ASSERT(limit);
- do
+ do {
result->put(exec, position, jsSingleCharacterSubstring(exec, input, position));
- while (++position < limit);
+ } while (++position < limit);
return JSValue::encode(result);
}