mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
woops, don't crash on empty string
This commit is contained in:
parent
d272f6a04c
commit
bd258bd79a
@ -1143,7 +1143,7 @@ Value = Transformer({
|
|||||||
return {
|
return {
|
||||||
"string",
|
"string",
|
||||||
delim,
|
delim,
|
||||||
part
|
part or ""
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return build.chain({
|
return build.chain({
|
||||||
|
@ -598,7 +598,7 @@ Value = Transformer {
|
|||||||
|
|
||||||
convert_part = (part) ->
|
convert_part = (part) ->
|
||||||
if type(part) == "string" or part == nil
|
if type(part) == "string" or part == nil
|
||||||
{"string", delim, part}
|
{"string", delim, part or ""}
|
||||||
else
|
else
|
||||||
build.chain { base: "tostring", {"call", {part[2]}} }
|
build.chain { base: "tostring", {"call", {part[2]}} }
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ hola = [===[
|
|||||||
|
|
||||||
mm = [[well trhere]]
|
mm = [[well trhere]]
|
||||||
|
|
||||||
|
oo = ""
|
||||||
|
|
||||||
x = "\\"
|
x = "\\"
|
||||||
x = "a\\b"
|
x = "a\\b"
|
||||||
|
@ -12,6 +12,7 @@ local hi_there = [[ hi there
|
|||||||
local well = [==[ "helo" ]==]
|
local well = [==[ "helo" ]==]
|
||||||
local hola = [===[ eat noots]===]
|
local hola = [===[ eat noots]===]
|
||||||
local mm = [[well trhere]]
|
local mm = [[well trhere]]
|
||||||
|
local oo = ""
|
||||||
local x = "\\"
|
local x = "\\"
|
||||||
x = "a\\b"
|
x = "a\\b"
|
||||||
x = "\\\n"
|
x = "\\\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user