mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
oops
This commit is contained in:
parent
6db1009b18
commit
c9bef247f4
@ -227,7 +227,8 @@ JsVar *jswrap_string_slice(JsVar *parent, JsVarInt pStart, JsVar *vEnd) {
|
||||
if (pEnd<0) pEnd = 0;
|
||||
res = jsvNewWithFlags(JSV_STRING);
|
||||
if (!res) return 0; // out of memory
|
||||
jsvAppendStringVar(res, parent, (size_t)pStart, (size_t)(pEnd-pStart));
|
||||
if (pEnd>pStart)
|
||||
jsvAppendStringVar(res, parent, (size_t)pStart, (size_t)(pEnd-pStart));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
|
||||
var r = [
|
||||
"foobar".slice(-1) === "r", // false, expected true
|
||||
"foobar".slice(-1, 10) === "r", // false, expected true
|
||||
"foobar".slice(-1, -1) === "", // false, expected true
|
||||
"foobar".slice(10, -10) === "", // false, expected true
|
||||
"foobar".slice(-1) === "r",
|
||||
"foobar".slice(-1, 10) === "r",
|
||||
"foobar".slice(-1, -1) === "",
|
||||
"foobar".slice(10, -10) === "",
|
||||
"Hello".slice(3,2) === "",
|
||||
];
|
||||
|
||||
var pass = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user