mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: Better type handling in makeNode()
This commit is contained in:
parent
530b8eb3ef
commit
5ee4d8fc97
@ -56,8 +56,10 @@ function makeNode(arg) {
|
||||
return parseExpression(arg, DEFAULT_BUILDER);
|
||||
} else if (arg instanceof Node) {
|
||||
return arg;
|
||||
} else {
|
||||
} else if (arg == null) {
|
||||
return undefined;
|
||||
} else {
|
||||
throw new Error('Argument should be a string or Node or null. Actual: ' + arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user