- This brings in the flow test suite that contains a ton of JavaScript parsing edge cases - This creates snapshot tests using the pretty printer for all of them - If uncomment `RUN_AST_TESTS` line in `tests/run_specs.js`, it checks ast(pretty_print(x)) == ast(x). Right now, "178 failed, 197 passed, 375 of 377 total". So half of the tests are not passing, most of them are crashes and many of the rest are subtle issues.
14 lines
486 B
JavaScript
14 lines
486 B
JavaScript
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
* @flow
|
|
*/
|
|
|
|
/* 'buffer' is the name of both an unchecked module in this directory,
|
|
* and a module declared in library file node.js.
|
|
* If the require below resolves to the unchecked module, the mistyping
|
|
* that follows will cause no errors, but if we resolve to the library
|
|
* instead, we'll get the desired error.
|
|
*/
|
|
var buffer = require("buffer");
|
|
var x: string = buffer.INSPECT_MAX_BYTES; // error, number ~/> string
|