Account for no newline before test annotations

Previously the license comment would always provide that newline but
since that's been removed this change is needed.
This commit is contained in:
Mark Rousskov 2018-12-26 09:00:55 -07:00
parent 2a663555dd
commit e132d9066d

View File

@ -164,9 +164,12 @@ function loadContent(content) {
var Module = module.constructor;
var m = new Module();
m._compile(content, "tmp.js");
m.exports.ignore_order = content.indexOf("\n// ignore-order\n") !== -1;
m.exports.exact_check = content.indexOf("\n// exact-check\n") !== -1;
m.exports.should_fail = content.indexOf("\n// should-fail\n") !== -1;
m.exports.ignore_order = content.indexOf("\n// ignore-order\n") !== -1 ||
content.startsWith("// ignore-order\n");
m.exports.exact_check = content.indexOf("\n// exact-check\n") !== -1 ||
content.startsWith("// exact-check\n");
m.exports.should_fail = content.indexOf("\n// should-fail\n") !== -1 ||
content.startsWith("// should-fail\n");
return m.exports;
}