From 7964e3bf11fea4b8197ec2fcc7cf49ecdca904a3 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 25 Jul 2015 06:14:09 +0100 Subject: [PATCH] fix broken tests --- packages/babylon/src/comments.js | 2 +- .../test/fixtures/core/uncategorised/102/expected.json | 4 +--- .../test/fixtures/core/uncategorised/103/expected.json | 4 +--- .../test/fixtures/core/uncategorised/104/expected.json | 4 +--- .../test/fixtures/core/uncategorised/105/expected.json | 4 +--- .../test/fixtures/core/uncategorised/106/expected.json | 4 +--- .../test/fixtures/core/uncategorised/107/expected.json | 4 +--- .../test/fixtures/core/uncategorised/108/expected.json | 4 +--- .../test/fixtures/core/uncategorised/341/expected.json | 4 +--- .../babylon/test/fixtures/core/uncategorised/4/expected.json | 4 +--- .../babylon/test/fixtures/core/uncategorised/5/expected.json | 4 +--- .../test/fixtures/core/uncategorised/541/expected.json | 4 +--- .../test/fixtures/harmony/uncategorised/317/expected.json | 4 +--- 13 files changed, 13 insertions(+), 37 deletions(-) diff --git a/packages/babylon/src/comments.js b/packages/babylon/src/comments.js index ca27fb5e8f..e9ee47f546 100644 --- a/packages/babylon/src/comments.js +++ b/packages/babylon/src/comments.js @@ -76,7 +76,7 @@ pp.processComment = function (node) { if (lastChild.leadingComments) { if (last(lastChild.leadingComments).range[1] <= node.range[0]) { node.leadingComments = lastChild.leadingComments; - delete lastChild.leadingComments; + lastChild.leadingComments = null; } else { // A leading comment for an anonymous class had been stolen by its first MethodDefinition, // so this takes back the leading comment. diff --git a/packages/babylon/test/fixtures/core/uncategorised/102/expected.json b/packages/babylon/test/fixtures/core/uncategorised/102/expected.json index 10904c64ce..009a9e4ed5 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/102/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/102/expected.json @@ -87,8 +87,6 @@ "column": 16 } }, - "value": {}, - "rawValue": {}, "raw": "/[a-z]/i", "regex": { "pattern": "[a-z]", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/103/expected.json b/packages/babylon/test/fixtures/core/uncategorised/103/expected.json index 9b73103b2b..ed4fe7cded 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/103/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/103/expected.json @@ -87,8 +87,6 @@ "column": 16 } }, - "value": {}, - "rawValue": {}, "raw": "/[x-z]/i", "regex": { "pattern": "[x-z]", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/104/expected.json b/packages/babylon/test/fixtures/core/uncategorised/104/expected.json index 4c39200a1b..b9f26b24b0 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/104/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/104/expected.json @@ -87,8 +87,6 @@ "column": 16 } }, - "value": {}, - "rawValue": {}, "raw": "/[a-c]/i", "regex": { "pattern": "[a-c]", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/105/expected.json b/packages/babylon/test/fixtures/core/uncategorised/105/expected.json index 70658dc7a2..9a938ecee4 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/105/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/105/expected.json @@ -87,8 +87,6 @@ "column": 17 } }, - "value": {}, - "rawValue": {}, "raw": "/[P QR]/i", "regex": { "pattern": "[P QR]", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/106/expected.json b/packages/babylon/test/fixtures/core/uncategorised/106/expected.json index e127e99aae..25323deabf 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/106/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/106/expected.json @@ -87,8 +87,6 @@ "column": 18 } }, - "value": {}, - "rawValue": {}, "raw": "/foo\\/bar/", "regex": { "pattern": "foo\\/bar", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/107/expected.json b/packages/babylon/test/fixtures/core/uncategorised/107/expected.json index be76b814d0..85f4f1e155 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/107/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/107/expected.json @@ -87,8 +87,6 @@ "column": 21 } }, - "value": {}, - "rawValue": {}, "raw": "/=([^=\\s])+/g", "regex": { "pattern": "=([^=\\s])+", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/108/expected.json b/packages/babylon/test/fixtures/core/uncategorised/108/expected.json index 3aaf113ec2..d37baa6dd8 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/108/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/108/expected.json @@ -87,8 +87,6 @@ "column": 22 } }, - "value": {}, - "rawValue": {}, "raw": "/[P QR]/\\u0067", "regex": { "pattern": "[P QR]", @@ -101,4 +99,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/341/expected.json b/packages/babylon/test/fixtures/core/uncategorised/341/expected.json index b7f3d7c7f4..88d5fefb2d 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/341/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/341/expected.json @@ -72,8 +72,6 @@ "column": 5 } }, - "value": {}, - "rawValue": {}, "raw": "/=/", "regex": { "pattern": "=", @@ -83,4 +81,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/4/expected.json b/packages/babylon/test/fixtures/core/uncategorised/4/expected.json index 8a599a7f4a..9c29ccb629 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/4/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/4/expected.json @@ -56,8 +56,6 @@ "column": 8 } }, - "value": {}, - "rawValue": {}, "raw": "/foobar/", "regex": { "pattern": "foobar", @@ -67,4 +65,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/5/expected.json b/packages/babylon/test/fixtures/core/uncategorised/5/expected.json index 13360f90cf..9b766664c8 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/5/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/5/expected.json @@ -56,8 +56,6 @@ "column": 8 } }, - "value": {}, - "rawValue": {}, "raw": "/[a-z]/g", "regex": { "pattern": "[a-z]", @@ -67,4 +65,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/core/uncategorised/541/expected.json b/packages/babylon/test/fixtures/core/uncategorised/541/expected.json index 77d7d954ac..ece4393a86 100644 --- a/packages/babylon/test/fixtures/core/uncategorised/541/expected.json +++ b/packages/babylon/test/fixtures/core/uncategorised/541/expected.json @@ -106,8 +106,6 @@ "column": 21 } }, - "value": {}, - "rawValue": {}, "raw": "/ 1 /", "regex": { "pattern": " 1 ", @@ -117,4 +115,4 @@ } ] } -} \ No newline at end of file +} diff --git a/packages/babylon/test/fixtures/harmony/uncategorised/317/expected.json b/packages/babylon/test/fixtures/harmony/uncategorised/317/expected.json index dbe9545412..a39ad7b107 100644 --- a/packages/babylon/test/fixtures/harmony/uncategorised/317/expected.json +++ b/packages/babylon/test/fixtures/harmony/uncategorised/317/expected.json @@ -113,8 +113,6 @@ "column": 7 } }, - "value": {}, - "rawValue": {}, "raw": "/\\d/", "regex": { "pattern": "\\d", @@ -227,4 +225,4 @@ } ] } -} \ No newline at end of file +}