From 052ced624a3d89fdf8e5edb8fea8c71e73abf96a Mon Sep 17 00:00:00 2001 From: "William C. Johnson" Date: Thu, 12 Oct 2017 19:03:27 -0400 Subject: [PATCH] Post-merge fixup --- src/tokenizer/index.js | 2 +- .../core/uncategorised/554/options.lightscript.json | 3 +++ .../esprima/invalid-syntax/migrated_0268/options.json | 2 +- .../invalid-syntax/migrated_0268/options.lightscript.json | 3 --- .../default-type-without-flow/options.json | 7 +++++++ .../template-literal-invalid-escapes-tagged/options.json | 6 +++++- test/fixtures/flow/type-annotations/135/actual.js | 2 +- test/fixtures/flow/type-annotations/136/actual.js | 4 ++-- test/fixtures/flow/type-annotations/137/actual.js | 2 +- test/fixtures/flow/type-annotations/138/actual.js | 2 +- test/fixtures/flow/type-annotations/139/actual.js | 2 +- .../error-block-starts-with-pattern/options.json | 3 --- .../object-block-ambiguity/error-obj/options.json | 3 --- .../object-block-ambiguity/pattern-block/options.json | 3 --- 14 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 test/fixtures/core/uncategorised/554/options.lightscript.json delete mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0268/options.lightscript.json create mode 100644 test/fixtures/experimental/export-extensions/default-type-without-flow/options.json diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 95f92211e0..6661e396ca 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -725,7 +725,7 @@ export default class Tokenizer { if (octal && this.state.pos == start + 1) octal = false; // number === 0 let next = this.input.charCodeAt(this.state.pos); - if (next === 46 && !octal) { // '.' + if (next === 46 && !octal && !noFloatsAllowed) { // '.' ++this.state.pos; this.readInt(10); isFloat = true; diff --git a/test/fixtures/core/uncategorised/554/options.lightscript.json b/test/fixtures/core/uncategorised/554/options.lightscript.json new file mode 100644 index 0000000000..9fc2027a2f --- /dev/null +++ b/test/fixtures/core/uncategorised/554/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript. (1:12)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json index 35ee7ea494..fd93ef8d98 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json @@ -1,4 +1,4 @@ { "excludePlugins": ["flow", "classProperties"], - "throws": "Unexpected token, expected ( (1:10)" + "throws": "Unexpected token (1:10)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.lightscript.json b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.lightscript.json deleted file mode 100644 index 89bfc2d73f..0000000000 --- a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.lightscript.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:10)" -} diff --git a/test/fixtures/experimental/export-extensions/default-type-without-flow/options.json b/test/fixtures/experimental/export-extensions/default-type-without-flow/options.json new file mode 100644 index 0000000000..c4da742cc6 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/default-type-without-flow/options.json @@ -0,0 +1,7 @@ +{ + "alternatives": { + "all": { + "excludePlugins": ["flow"] + } + } +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json index eb93fe5b94..9f7cb28df8 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json @@ -1,3 +1,7 @@ { - "plugins": ["templateInvalidEscapes"] + "alternatives": { + "all": { + "includePlugins": ["templateInvalidEscapes"] + } + } } diff --git a/test/fixtures/flow/type-annotations/135/actual.js b/test/fixtures/flow/type-annotations/135/actual.js index b79dc870ee..c7a1a030de 100644 --- a/test/fixtures/flow/type-annotations/135/actual.js +++ b/test/fixtures/flow/type-annotations/135/actual.js @@ -1,3 +1,3 @@ type A = { - ...any, + ...any, }; diff --git a/test/fixtures/flow/type-annotations/136/actual.js b/test/fixtures/flow/type-annotations/136/actual.js index 09c0a04398..dedc0308d2 100644 --- a/test/fixtures/flow/type-annotations/136/actual.js +++ b/test/fixtures/flow/type-annotations/136/actual.js @@ -1,4 +1,4 @@ type A = { - p: {}, - ...{}, + p: {}, + ...{}, }; diff --git a/test/fixtures/flow/type-annotations/137/actual.js b/test/fixtures/flow/type-annotations/137/actual.js index b039a41ed2..01cb0ff54f 100644 --- a/test/fixtures/flow/type-annotations/137/actual.js +++ b/test/fixtures/flow/type-annotations/137/actual.js @@ -1,3 +1,3 @@ interface A { - ...any, + ...any, }; diff --git a/test/fixtures/flow/type-annotations/138/actual.js b/test/fixtures/flow/type-annotations/138/actual.js index 9a607c669f..77fb2e7812 100644 --- a/test/fixtures/flow/type-annotations/138/actual.js +++ b/test/fixtures/flow/type-annotations/138/actual.js @@ -1,5 +1,5 @@ class A {} class B {} type C = { - ...A&B + ...A&B }; diff --git a/test/fixtures/flow/type-annotations/139/actual.js b/test/fixtures/flow/type-annotations/139/actual.js index 13ea6cb771..c0368f8f26 100644 --- a/test/fixtures/flow/type-annotations/139/actual.js +++ b/test/fixtures/flow/type-annotations/139/actual.js @@ -1,4 +1,4 @@ class A {} type C = { - -...A + -...A }; diff --git a/test/fixtures/lightscript/object-block-ambiguity/error-block-starts-with-pattern/options.json b/test/fixtures/lightscript/object-block-ambiguity/error-block-starts-with-pattern/options.json index 534b3b7585..0cd0ce950b 100644 --- a/test/fixtures/lightscript/object-block-ambiguity/error-block-starts-with-pattern/options.json +++ b/test/fixtures/lightscript/object-block-ambiguity/error-block-starts-with-pattern/options.json @@ -3,9 +3,6 @@ "all": { "throws": "Unexpected token (3:3)" }, - "whiteblockOnly": { - "throws": "Unexpected token (3:3)" - }, "braceblock": { "throws": "Unexpected token (3:3)" } diff --git a/test/fixtures/lightscript/object-block-ambiguity/error-obj/options.json b/test/fixtures/lightscript/object-block-ambiguity/error-obj/options.json index 775b361f69..dcbe1e12a5 100644 --- a/test/fixtures/lightscript/object-block-ambiguity/error-obj/options.json +++ b/test/fixtures/lightscript/object-block-ambiguity/error-obj/options.json @@ -3,9 +3,6 @@ "all": { "throws": "Expected an Indent or Statement (7:6)" }, - "whiteblockOnly": { - "throws": "Expected an Indent or Statement (7:6)" - }, "braceblock": { "throws": "Leading decorators must be attached to a class declaration (7:2)" } diff --git a/test/fixtures/lightscript/object-block-ambiguity/pattern-block/options.json b/test/fixtures/lightscript/object-block-ambiguity/pattern-block/options.json index f2a7da2e70..ec476dae66 100644 --- a/test/fixtures/lightscript/object-block-ambiguity/pattern-block/options.json +++ b/test/fixtures/lightscript/object-block-ambiguity/pattern-block/options.json @@ -3,9 +3,6 @@ "all": { "throws": "Cannot parse brace-delimited construct as an object or as a block. When parsed as an object, the error is: Unexpected token, expected , (3:3)" }, - "whiteblockOnly": { - "throws": "Unexpected token, expected , (3:3)" - }, "braceblock": { "throws": "Unexpected token, expected , (3:3)" }