Changed how parserContextFlags are handled in tests
This commit is contained in:
parent
ae27b89847
commit
b5da80202f
2 changed files with 4 additions and 5 deletions
|
@ -285,6 +285,10 @@ namespace Utils {
|
||||||
// data we don't care about in the dump. We only care what the parser set directly
|
// data we don't care about in the dump. We only care what the parser set directly
|
||||||
// on the ast.
|
// on the ast.
|
||||||
let value = n.parserContextFlags & ts.ParserContextFlags.ParserGeneratedFlags;
|
let value = n.parserContextFlags & ts.ParserContextFlags.ParserGeneratedFlags;
|
||||||
|
|
||||||
|
// Remove the JavaScriptFile flag, as this is just noise for JSDocParser and Test262 tests
|
||||||
|
// (which are the only tests that use this function).
|
||||||
|
value = value & ~ts.ParserContextFlags.JavaScriptFile;
|
||||||
if (value) {
|
if (value) {
|
||||||
o[propertyName] = getParserContextFlagName(value);
|
o[propertyName] = getParserContextFlagName(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,6 @@ module ts {
|
||||||
|
|
||||||
let result = Utils.sourceFileToJSON(typeAndDiagnostics.jsDocTypeExpression.type);
|
let result = Utils.sourceFileToJSON(typeAndDiagnostics.jsDocTypeExpression.type);
|
||||||
|
|
||||||
// Remove the parserContextFlags from the comparison
|
|
||||||
result = result.replace(/\,\n\s+\"parserContextFlags\": \"JavaScriptFile\"/g, "");
|
|
||||||
assert.equal(result, expected);
|
assert.equal(result, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,9 +1000,6 @@ module ts {
|
||||||
: v;
|
: v;
|
||||||
}, 4);
|
}, 4);
|
||||||
|
|
||||||
// Remove the parserContextFlags from the comparison
|
|
||||||
result = result.replace(/\,\n\s+\"parserContextFlags\": \"JavaScriptFile\"/g, "");
|
|
||||||
|
|
||||||
if (result !== expected) {
|
if (result !== expected) {
|
||||||
// Turn on a human-readable diff
|
// Turn on a human-readable diff
|
||||||
if (typeof require !== 'undefined') {
|
if (typeof require !== 'undefined') {
|
||||||
|
|
Loading…
Reference in a new issue