Skip to content

Commit 64de473

Browse files
committed
Update babel parser
1 parent 3384c08 commit 64de473

24 files changed

+1263
-1117
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"presets": [
3-
["env", {
3+
["@babel/preset-env", {
44
"targets": {
55
"node": 6
66
},
77
"include": ["transform-regenerator"]
88
}],
9-
"flow"
9+
"@babel/preset-flow"
1010
],
1111
"plugins": ["syntax-async-functions"],
1212
"ignore": [

__tests__/__snapshots__/test.js.snap

Lines changed: 5 additions & 311 deletions
Original file line numberDiff line numberDiff line change
@@ -14962,11 +14962,11 @@ Array [
1496214962
"loc": Object {
1496314963
"end": Object {
1496414964
"column": 41,
14965-
"line": 11,
14965+
"line": 14,
1496614966
},
1496714967
"start": Object {
1496814968
"column": 0,
14969-
"line": 11,
14969+
"line": 14,
1497014970
},
1497114971
},
1497214972
},
@@ -15028,11 +15028,11 @@ Array [
1502815028
"loc": Object {
1502915029
"end": Object {
1503015030
"column": 3,
15031-
"line": 10,
15031+
"line": 13,
1503215032
},
1503315033
"start": Object {
1503415034
"column": 0,
15035-
"line": 7,
15035+
"line": 10,
1503615036
},
1503715037
},
1503815038
"members": Object {
@@ -15046,7 +15046,7 @@ Array [
1504615046
"namespace": "multiplyTwice",
1504715047
"params": Array [
1504815048
Object {
15049-
"lineNumber": 11,
15049+
"lineNumber": 14,
1505015050
"name": "a",
1505115051
"title": "param",
1505215052
},
@@ -39309,312 +39309,6 @@ Object {
3930939309
}
3931039310
`;
3931139311

39312-
exports[`outputs system-import.input.js JSON 1`] = `
39313-
Array [
39314-
Object {
39315-
"augments": Array [],
39316-
"context": Object {
39317-
"loc": Object {
39318-
"end": Object {
39319-
"column": 2,
39320-
"line": 8,
39321-
},
39322-
"start": Object {
39323-
"column": 0,
39324-
"line": 5,
39325-
},
39326-
},
39327-
},
39328-
"description": Object {
39329-
"children": Array [
39330-
Object {
39331-
"children": Array [
39332-
Object {
39333-
"position": Object {
39334-
"end": Object {
39335-
"column": 38,
39336-
"line": 1,
39337-
"offset": 37,
39338-
},
39339-
"indent": Array [],
39340-
"start": Object {
39341-
"column": 1,
39342-
"line": 1,
39343-
"offset": 0,
39344-
},
39345-
},
39346-
"type": "text",
39347-
"value": "This function returns the number one.",
39348-
},
39349-
],
39350-
"position": Object {
39351-
"end": Object {
39352-
"column": 38,
39353-
"line": 1,
39354-
"offset": 37,
39355-
},
39356-
"indent": Array [],
39357-
"start": Object {
39358-
"column": 1,
39359-
"line": 1,
39360-
"offset": 0,
39361-
},
39362-
},
39363-
"type": "paragraph",
39364-
},
39365-
],
39366-
"position": Object {
39367-
"end": Object {
39368-
"column": 38,
39369-
"line": 1,
39370-
"offset": 37,
39371-
},
39372-
"start": Object {
39373-
"column": 1,
39374-
"line": 1,
39375-
"offset": 0,
39376-
},
39377-
},
39378-
"type": "root",
39379-
},
39380-
"errors": Array [],
39381-
"examples": Array [],
39382-
"kind": "function",
39383-
"loc": Object {
39384-
"end": Object {
39385-
"column": 3,
39386-
"line": 4,
39387-
},
39388-
"start": Object {
39389-
"column": 0,
39390-
"line": 1,
39391-
},
39392-
},
39393-
"members": Object {
39394-
"events": Array [],
39395-
"global": Array [],
39396-
"inner": Array [],
39397-
"instance": Array [],
39398-
"static": Array [],
39399-
},
39400-
"name": "simple.input",
39401-
"namespace": "simple.input",
39402-
"params": Array [],
39403-
"path": Array [
39404-
Object {
39405-
"kind": "function",
39406-
"name": "simple.input",
39407-
},
39408-
],
39409-
"properties": Array [],
39410-
"returns": Array [
39411-
Object {
39412-
"description": Object {
39413-
"children": Array [
39414-
Object {
39415-
"children": Array [
39416-
Object {
39417-
"position": Object {
39418-
"end": Object {
39419-
"column": 10,
39420-
"line": 1,
39421-
"offset": 9,
39422-
},
39423-
"indent": Array [],
39424-
"start": Object {
39425-
"column": 1,
39426-
"line": 1,
39427-
"offset": 0,
39428-
},
39429-
},
39430-
"type": "text",
39431-
"value": "numberone",
39432-
},
39433-
],
39434-
"position": Object {
39435-
"end": Object {
39436-
"column": 10,
39437-
"line": 1,
39438-
"offset": 9,
39439-
},
39440-
"indent": Array [],
39441-
"start": Object {
39442-
"column": 1,
39443-
"line": 1,
39444-
"offset": 0,
39445-
},
39446-
},
39447-
"type": "paragraph",
39448-
},
39449-
],
39450-
"position": Object {
39451-
"end": Object {
39452-
"column": 10,
39453-
"line": 1,
39454-
"offset": 9,
39455-
},
39456-
"start": Object {
39457-
"column": 1,
39458-
"line": 1,
39459-
"offset": 0,
39460-
},
39461-
},
39462-
"type": "root",
39463-
},
39464-
"title": "returns",
39465-
"type": Object {
39466-
"name": "number",
39467-
"type": "NameExpression",
39468-
},
39469-
},
39470-
],
39471-
"sees": Array [],
39472-
"tags": Array [
39473-
Object {
39474-
"description": "numberone",
39475-
"lineNumber": 2,
39476-
"title": "returns",
39477-
"type": Object {
39478-
"name": "number",
39479-
"type": "NameExpression",
39480-
},
39481-
},
39482-
],
39483-
"throws": Array [],
39484-
"todos": Array [],
39485-
},
39486-
]
39487-
`;
39488-
39489-
exports[`outputs system-import.input.js markdown 1`] = `"[object Object]"`;
39490-
39491-
exports[`outputs system-import.input.js markdown AST 1`] = `
39492-
Object {
39493-
"children": Array [
39494-
Object {
39495-
"type": "html",
39496-
"value": "<!-- Generated by documentation.js. Update this documentation by updating the source code. -->",
39497-
},
39498-
Object {
39499-
"children": Array [
39500-
Object {
39501-
"type": "text",
39502-
"value": "simple.input",
39503-
},
39504-
],
39505-
"depth": 2,
39506-
"type": "heading",
39507-
},
39508-
Object {
39509-
"children": Array [
39510-
Object {
39511-
"position": Position {
39512-
"end": Object {
39513-
"column": 38,
39514-
"line": 1,
39515-
"offset": 37,
39516-
},
39517-
"indent": Array [],
39518-
"start": Object {
39519-
"column": 1,
39520-
"line": 1,
39521-
"offset": 0,
39522-
},
39523-
},
39524-
"type": "text",
39525-
"value": "This function returns the number one.",
39526-
},
39527-
],
39528-
"position": Position {
39529-
"end": Object {
39530-
"column": 38,
39531-
"line": 1,
39532-
"offset": 37,
39533-
},
39534-
"indent": Array [],
39535-
"start": Object {
39536-
"column": 1,
39537-
"line": 1,
39538-
"offset": 0,
39539-
},
39540-
},
39541-
"type": "paragraph",
39542-
},
39543-
Object {
39544-
"children": Array [
39545-
Object {
39546-
"type": "text",
39547-
"value": "Returns ",
39548-
},
39549-
Object {
39550-
"children": Array [
39551-
Object {
39552-
"children": Array [
39553-
Object {
39554-
"type": "text",
39555-
"value": "number",
39556-
},
39557-
],
39558-
"identifier": "1",
39559-
"referenceType": "full",
39560-
"type": "linkReference",
39561-
},
39562-
],
39563-
"type": "strong",
39564-
},
39565-
Object {
39566-
"type": "text",
39567-
"value": " ",
39568-
},
39569-
Object {
39570-
"children": Array [
39571-
Object {
39572-
"position": Position {
39573-
"end": Object {
39574-
"column": 10,
39575-
"line": 1,
39576-
"offset": 9,
39577-
},
39578-
"indent": Array [],
39579-
"start": Object {
39580-
"column": 1,
39581-
"line": 1,
39582-
"offset": 0,
39583-
},
39584-
},
39585-
"type": "text",
39586-
"value": "numberone",
39587-
},
39588-
],
39589-
"position": Position {
39590-
"end": Object {
39591-
"column": 10,
39592-
"line": 1,
39593-
"offset": 9,
39594-
},
39595-
"indent": Array [],
39596-
"start": Object {
39597-
"column": 1,
39598-
"line": 1,
39599-
"offset": 0,
39600-
},
39601-
},
39602-
"type": "paragraph",
39603-
},
39604-
],
39605-
"type": "paragraph",
39606-
},
39607-
Object {
39608-
"identifier": "1",
39609-
"title": undefined,
39610-
"type": "definition",
39611-
"url": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number",
39612-
},
39613-
],
39614-
"type": "root",
39615-
}
39616-
`;
39617-
3961839312
exports[`outputs this-class.input.js JSON 1`] = `
3961939313
Array [
3962039314
Object {

__tests__/bin-watch-serve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function documentation(args, options) {
1414
}
1515

1616
options.maxBuffer = 1024 * 1024;
17-
args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js'));
17+
args.unshift(path.resolve(__dirname, '..', 'bin', 'documentation.js'));
1818

1919
return spawn('node', args, options);
2020
}

__tests__/fixture/es6-import.input.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import hasEx6 from './es6-ext';
22
import multiply from './simple.input.js';
33
import * as foo from 'some-other-module';
44

5-
import('./simple.input.js').then(() => {});
5+
// Disable dynamic imports for now until
6+
// https://github.com/thgreasi/babel-plugin-system-import-transformer
7+
// can be updated to support babel 7.
8+
// import('./simple.input.js').then(() => {});
69

710
/**
811
* This function returns the number one.

__tests__/fixture/system-import.input.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)