[x] The new code additions passed the tests (npm test).
[x] The linter ran and found no issues (npm run-script lint).
Quelques warnings mais ils étaient là avant.
Description
This PR fixes a bug in the compiler with empty INCLUDEs.
Example:
// main.ink
INCLUDE a.ink
INCLUDE b.ink
{foo}
// a.ink (empty file)
// b.ink
VAR foo = "bar"
If you compile it with the inkjs.Compiler and a correctly set-up JsonFileHandler, the story fails at run-time with Unresolved variable: foo.
If a.ink is not empty (a single space character is enough), everything works as expected.
This bug is caused by a falsy value ("") not taking the correct branch in an if statement if (includedString). This PR fixes that if with a stricter check: if (includedString != null).
Checklist
npm test
).npm run-script lint
).Description
This PR fixes a bug in the compiler with empty INCLUDEs.
Example:
If you compile it with the inkjs.Compiler and a correctly set-up JsonFileHandler, the story fails at run-time with
Unresolved variable: foo
. Ifa.ink
is not empty (a single space character is enough), everything works as expected.This bug is caused by a falsy value ("") not taking the correct branch in an if statement
if (includedString)
. This PR fixes that if with a stricter check:if (includedString != null)
.