Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Breaking: Support unique symbol (fixes #426) #433

Merged
merged 1 commit into from
Feb 9, 2018

Conversation

azz
Copy link
Contributor

@azz azz commented Jan 11, 2018

This changes captures TSTypeOperator and treats it like a unary operator. It breaks keyof foo and adds support for unique symbol. The TSTypeOperator node's typeAnnotation parameter is now the TSTypeReference, rather than a TSTypeAnnotation which has a TSTypeReference. (more direct), this is to align with babylon.

@@ -30,11 +30,12 @@
                "start": Object {
                  "column": 9,
                  "line": 1,
                },
              },
-             "operator": 140,
+             "operator": "unique",
+             "prefix": true,
              "range": Array [
                9,
                22,
              ],
              "type": "TSTypeOperator",
@@ -43,36 +44,19 @@
                  "end": Object {
                    "column": 22,
                    "line": 1,
                  },
                  "start": Object {
-                   "column": 14,
+                   "column": 16,
                    "line": 1,
                  },
                },
                "range": Array [
-                 14,
+                 16,
                  22,
                ],
-               "type": "TSTypeAnnotation",
-               "typeAnnotation": Object {
-                 "loc": Object {
-                   "end": Object {
-                     "column": 22,
-                     "line": 1,
-                   },
-                   "start": Object {
-                     "column": 16,
-                     "line": 1,
-                   },
-                 },
-                 "range": Array [
-                   16,
-                   22,
-                 ],
-                 "type": "TSSymbolKeyword",
-               },
+               "type": "TSSymbolKeyword",
              },
            },
            "loc": Object {
              "end": Object {
                "column": 23,

@JamesHenry
Copy link
Member

These kinds of things (the typeAnnotation breaking change) are super tricky in the AST.

You can see a near identical point here: babel/babel#7086

@JamesHenry
Copy link
Member

I've pinged Andy and Daniel to get their thoughts on this

@JamesHenry
Copy link
Member

I've started a protected ts-2.7 branch as we normally do with changes which relate to not yet stable versions of TS. Please change the base to be that branch

@azz azz changed the base branch from master to ts-2.7 January 12, 2018 15:14
@azz
Copy link
Contributor Author

azz commented Jan 27, 2018

Updated to remove prefix: true as per babel/babel#7239 (comment)

@JamesHenry
Copy link
Member

Thanks for your patience on this, @azz. I'm having a very difficult 2018 so far, my Grandad died and I've been forced to leave my home due to flooding. Started to get back on track this week, so digging into all these things now.

This one is currently failing the build, but I really want to get a 2.7 compatible release out, so just going to merge and fix up any issues myself.

@JamesHenry JamesHenry merged commit c08f11a into eslint:ts-2.7 Feb 9, 2018
@azz azz deleted the unique-symbol branch February 10, 2018 02:22
@azz
Copy link
Contributor Author

azz commented Feb 10, 2018

Really sorry to hear that 😔. Hope the rest of the year is better to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants