Skip to content

Commit

Permalink
Catch up to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohnson committed Oct 8, 2017
1 parent 8c36f6c commit ea1ddf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var jsParse = require("babylon").parse;
var babel = require("babel-core");
var lscPlugin = require("@oigroup/babel-plugin-lightscript");
var lscConfig = require("@oigroup/babel-plugin-lightscript/lib/config");
var parseConfigurationDirectives = require("@oigroup/babel-plugin-lightscript/lib/util/parseConfigurationDirectives");
var t = require("babel-types");
var tt = require("@oigroup/babylon-lightscript").tokTypes;
var traverse = require("babel-traverse").default;
Expand Down Expand Up @@ -449,7 +450,7 @@ exports.parseNoPatch = function (code, options) {
// and come up with all this stuff.
// (This setup step should also read .babelrc)
var filePath = options.filePath;
var configOpts = lscConfig.parseConfigurationDirectives(code);
var configOpts = parseConfigurationDirectives(code);
var useLsc = (configOpts.isLightScript || !filePath || /\.(lsc|lsx)/.test(filePath) || filePath === "unknown");

var ast;
Expand Down
11 changes: 6 additions & 5 deletions test/babel-eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,12 @@ describe("babylon-to-esprima", () => {
parseAndAssertSame("var a = function (...b) {}");
});

it("SpreadOperator", () => {
parseAndAssertSame("var a = { b, ...c }");
parseAndAssertSame("var a = [ a, ...b ]");
parseAndAssertSame("var a = summa(...b)");
});
// LightScript: safe spread operator transform breaks this test.
// it("SpreadOperator", () => {
// parseAndAssertSame("var a = { b, ...c }");
// parseAndAssertSame("var a = [ a, ...b ]");
// parseAndAssertSame("var a = summa(...b)");
// });

it("Async/Await", () => {
parseAndAssertSame(
Expand Down
10 changes: 0 additions & 10 deletions test/non-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,6 @@ y = -> [_0, ..._]
);
});

it("pipe operator", () => {
verifyAndAssertMessages(
unpad(`
1 |> (x -> x) |> (y -> y)
`),
{},
[]
);
});

//////////// end lsc tests
});

Expand Down

0 comments on commit ea1ddf6

Please sign in to comment.