Skip to content

Commit

Permalink
3.1
Browse files Browse the repository at this point in the history
commit e94333e
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Tue May 15 00:04:48 2018 -0700

    Convert rest to spread when implicitly inserting `super()` call

    - Fixes wcjohnson/lightscript#74

commit 295f213
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Tue May 15 00:03:13 2018 -0700

    Move CHANGELOG to root package

commit 30840da
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Mon May 14 23:46:45 2018 -0700

    Implicit const for vanilla JS `for`/`in` loops.

    - Fixes wcjohnson/lightscript#66

commit 1c9ef82
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Sun Nov 5 23:41:40 2017 -0500

    @oigroup/babel-plugin-lightscript@3.1.0-alpha.2

commit b39a53f
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Sun Nov 5 23:40:18 2017 -0500

    `try` changes

commit e86f345
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 22:48:18 2017 -0400

    @oigroup/babel-plugin-lightscript@3.1.0-alpha.1

commit 9f1b791
Merge: 7ac8e18 9d7ab88
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 22:46:38 2017 -0400

    Merge branch 'feature/enhanced-try' into prerelease/3.1.0

commit 9d7ab88
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 22:45:16 2017 -0400

    Enhanced `try`

commit 7ac8e18
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:44:04 2017 -0400

    @oigroup/babel-plugin-lightscript@3.1.0-alpha.0

commit 852c75b
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:41:00 2017 -0400

    Package fix

commit e2597d9
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:32:56 2017 -0400

    Test fixup

commit 8d2afde
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:25:45 2017 -0400

    New `CatchExpression` transforms

commit 2187800
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:25:18 2017 -0400

    Revert change dropping `await` on `return`

    Reverses lightscript#23

    `return await x` is semantically different from `return x`. The user should be in control of when he wants which semantics, rather than `await` implicitly being dropped.

commit e577175
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 15:21:21 2017 -0400

    Remove straggler files from merge

commit 1e1c00f
Author: William C. Johnson <wcjohnson@oigroup.net>
Date:   Wed Oct 25 12:41:15 2017 -0400

    3.0

    commit 7818505
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 25 00:32:49 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.9

    commit 5e922b2
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 25 00:31:32 2017 -0400

        Remove extraneous logging

    commit d504a9c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 25 00:10:27 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.8

    commit 9274bb2
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 25 00:09:11 2017 -0400

        Fix for bound catchExprs

    commit 77a1b4d
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:54:47 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.7

    commit 8e30cfa
    Merge: 8c2ba15 4102f4c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:52:54 2017 -0400

        Merge branch 'feature/catch-expressions' into prerelease/3.0.0

    commit 4102f4c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:50:18 2017 -0400

        Options

    commit 7dedab3
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:48:28 2017 -0400

        Catch expr optimization

    commit 2810f87
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:11:47 2017 -0400

        `CatchExpression`s

    commit ab8ff83
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:11:26 2017 -0400

        Tail into `catch` blocks

    commit 7da6b5e
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 24 23:11:11 2017 -0400

        Export matching api

    commit 8c2ba15
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 22 15:18:17 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.6

    commit 1e8181b
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 22 15:10:27 2017 -0400

        Added bang await arrow test

    commit fa3f459
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Oct 21 13:56:58 2017 -0400

        Re-disable `!(`

    commit 01e06c3
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 20 21:02:13 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.5

    commit 9f7065c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 20 20:54:48 2017 -0400

        Named exports no longer trigger stdlib imports

        - Fixes wcjohnson/lightscript#56

    commit 1328737
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 20 16:12:19 2017 -0400

        Implicitly return class declarations

        Addresses wcjohnson/lightscript#55

    commit 409af7a
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 19 16:51:36 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.4

    commit 34da5a5
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 19 16:43:19 2017 -0400

        Spaceless subscripts of bang calls

    commit 606c95f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 21:08:33 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.3

    commit 2680b70
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 20:45:15 2017 -0400

        Commaless import/export tests

    commit b49382f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 20:18:48 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.2

    commit 94b9467
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 20:15:23 2017 -0400

        Packaging updates

    commit 999023e
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 20:03:42 2017 -0400

        Update deps

    commit ee25f1f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 19:12:03 2017 -0400

        update README

    commit 0d80f0c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 19:05:47 2017 -0400

        Catch up with Babylon 6 merge

    commit 5e48ddd
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Oct 12 16:56:18 2017 -0400

        Register function decls on entry

        - Fixes wcjohnson/lightscript#49

    commit 984d72d
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 11 21:38:49 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.1

    commit 3dc9c90
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 11 01:24:02 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-beta.0

    commit 2bbf09e
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 10 20:40:36 2017 -0400

        Safe spread optimizations

    commit 233f224
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 9 20:54:48 2017 -0400

        `for..of` auto const

        Fixes wcjohnson/lightscript#41

    commit f95f78b
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 9 20:31:38 2017 -0400

        Remove `whiteblock`

    commit b9ca11a
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 9 20:29:51 2017 -0400

        Tests related to parser changes re: flow casts

    commit 2a81a4f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 9 20:29:20 2017 -0400

        Packaging: Use AUTHORS file

    commit 4b6ee6b
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 21:30:31 2017 -0400

        Tooling API updates

    commit 09ccb87
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 21:30:22 2017 -0400

        Whiteblock early termination testing

    commit b20bd66
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 16:35:29 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.6

    commit 2c8446a
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 16:26:13 2017 -0400

        Remove `for-of` variable qualifier requirement

        wcjohnson/lightscript#38

    commit 0ec702c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 15:40:55 2017 -0400

        Allow bjects with single string literal keys in tail position

    commit c69f7e9
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 15:26:38 2017 -0400

        Changelog updates

    commit d329e69
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 01:18:02 2017 -0400

        Add unit test for object with methods

    commit ee270bf
    Merge: e7a0f21 cb3f582
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 01:13:56 2017 -0400

        Merge branch 'feature/spread-loop' into prerelease/3.0.0

    commit cb3f582
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Oct 8 01:13:38 2017 -0400

        Spread loops

    commit e7a0f21
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Oct 7 22:53:16 2017 -0400

        Add .gitattributes for syntax highlighting

    commit a70f9e1
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Oct 7 15:56:26 2017 -0400

        Tooling API (wip)

    commit 3936ca6
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 6 23:54:56 2017 -0400

        Compiler config cleanup

        - eliminated hack checking for test fixture in file path
        - Can pass `isLightScript: true` to Babel opts to force compile as LSC
        - Updated test suite

    commit 416c326
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 6 22:16:05 2017 -0400

        Remove `pipeCall`

        wcjohnson/lightscript#36

    commit 9578116
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 6 17:49:49 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.5

    commit 1ccb6fb
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Fri Oct 6 17:04:21 2017 -0400

        Test fixture for bangCall bug

        Re wcjohnson/lightscript#33

    commit 8340c21
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Oct 4 16:52:27 2017 -0400

        Code cleanup, part 2

    commit 6e62f05
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 3 20:51:16 2017 -0400

        Code cleanup

    commit 71e54e6
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 3 20:50:55 2017 -0400

        Parity with parser updates

    commit a20b583
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 3 17:13:26 2017 -0400

        Update self-hosting to 3.0

    commit fe31d8c
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 3 15:26:03 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.4

    commit 7b7dd39
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Oct 3 15:14:34 2017 -0400

        Re-enable safe call by default

    commit fbb4ddc
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 2 22:18:16 2017 -0400

        Changelog updates

    commit 677f6b6
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 2 21:36:18 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.3

    commit 0510d65
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 2 21:14:36 2017 -0400

        Make `enhancedComprehension` the default

    commit 787f2d7
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 2 20:12:27 2017 -0400

        Revert safe traversal policy

        - `safeCall` no longer enabled by default
        - Remove `?.(` syntax
        - Update changelog accordingly

    commit e2f3e68
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Oct 2 19:57:33 2017 -0400

        `toBlockArrowFunctionExpression` now preserves skinny arrows

        Addresses wcjohnson/lightscript#29

    commit 8315dda
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Sep 30 22:09:45 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.2

    commit fe283a4
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Sep 30 22:08:25 2017 -0400

        Changelog updates

    commit 8c6b3fc
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Sep 30 21:44:58 2017 -0400

        `whiteblockPreferred` mode

    commit e39110d
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Sep 28 21:27:28 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.1

    commit 9c2b173
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Thu Sep 28 21:10:15 2017 -0400

        Splat comprehensions

        commit 4b4979e
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Thu Sep 28 21:09:41 2017 -0400

            Changelog

        commit d809a5e
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Thu Sep 28 19:57:21 2017 -0400

            Throw on empty comprehensions

        commit 8b37b95
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Thu Sep 28 19:50:22 2017 -0400

            Fix: `LabeledStatement` bodies now included in tail transforms

        commit dab8a33
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Thu Sep 28 19:07:51 2017 -0400

            Enhanced comprehensions use `…` syntax

    commit f59cf36
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Sep 27 22:17:24 2017 -0400

        @oigroup/babel-plugin-lightscript@3.0.0-alpha.0

    commit 585eb2d
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Sep 27 22:14:00 2017 -0400

        packaging fixup

    commit f58c0e2
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Sep 27 21:59:53 2017 -0400

        3.0 updates

        - `whiteblock` mode
        - `bangCall` on by default
        - `safeCall` on by default
        - `seqExprRequiresParen` by default

    commit 2eaefe3
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Sep 25 15:45:12 2017 -0400

        Cleanup

    commit a246ed9
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Sep 24 20:16:38 2017 -0400

        Add unit test for `UpdateExpression` in safe chain

    commit d62a44f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Sep 24 20:01:27 2017 -0400

        Add changelog

    commit 760ec66
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Sep 24 19:23:40 2017 -0400

        Use Babel `optional-chaining` algorithm for safe expressions

        commit 187231c
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 19:22:43 2017 -0400

            Misc cleanup

        commit cd7cdb0
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 19:11:17 2017 -0400

            Move safe transforms to a separate AST visitor pass

        commit 832cf9d
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 17:40:19 2017 -0400

            Restore unit test related to tilde chaining

        commit 9ac1dd4
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 17:38:48 2017 -0400

            Remove old safecall code

        commit 0141061
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 17:34:49 2017 -0400

            Correct memoization for `CallExpression` with `MemberExpression` callee

        commit 2766ce4
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 01:59:30 2017 -0400

            Eliminate `TildeCallExpression` node type

        commit f2c3328
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 01:06:19 2017 -0400

            Check `typeof(x) === function` in safecalls

        commit c39b0d1
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 00:47:48 2017 -0400

            Babel safe transforms, phase 2

            - Avoid memoising simple identifiers

        commit 83ff2d1
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 00:22:26 2017 -0400

            Ref cleanup

        commit c592784
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 00:17:12 2017 -0400

            Perform block-body fixup for optional chaining in first ast pass

        commit 1134d99
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Sep 24 00:09:41 2017 -0400

            Cherry-pick block body fix from 2.3.0

        commit c40d0a9
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sat Sep 23 23:48:26 2017 -0400

            Preliminary babel safe transform impl

    commit 40317d1
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Sep 23 21:20:10 2017 -0400

        Missing branches of branching constructs now generate `undefined` instead of `null`

        Addresses lightscript/lightscript#45

    commit 6b18454
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sat Sep 23 17:28:25 2017 -0400

        Converge optional member expressions with Babel, step 1

        - Eliminate `SafeMemberExpression` node type
        - Allow `MemberExpressions` with `optional = true`
        - Change `CallExpression` safe flag from `safe` to `optional`

    commit 73c402f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Sep 18 23:16:08 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-alpha.3

    commit 8e3a391
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Sep 18 23:10:51 2017 -0400

        Fix for SafeMemberExpressions in ArrowFunctionExpressions

        See wcjohnson/lightscript#23

    commit e99764b
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Sep 5 16:51:02 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-alpha.2

    commit 6b9f6b7
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Tue Sep 5 16:13:36 2017 -0400

        Placeholder design changes

        - Mixing indexed and non-indexed placeholders is now illegal.
        - Non-indexed placeholder is like Kotlin `it` and always refers to the first arg no matter how many times it’s used. E.g.: `-> g(_, _)` is `f(arg0) -> g(arg0, arg0)`. Contrast with before where this would have made two different args.
        - Indexed placeholders refer to zero-indexed args and are not collapsed. E.g.: `-> _1` compiles to `f(arg0, arg1) -> arg1`
        - Spread placeholders can be used with either indexed or non-indexed placeholders and always generate a rest arg in the last position.

    commit 8ccd716
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Jul 19 21:43:43 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-alpha.1

    commit ca983c3
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Wed Jul 19 21:32:18 2017 -0400

        Reversed pipe call support

    commit c4c91a5
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Jul 17 16:09:14 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-alpha.0

    commit 662ddcc
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Jul 17 00:43:23 2017 -0400

        `pipeCall` tests

    commit 4d0e951
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Jul 17 00:28:41 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-2

    commit 02ad790
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Mon Jul 17 00:25:42 2017 -0400

        `babel-types` patch: improve registration

    commit 50af726
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Jul 16 23:19:24 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-1

    commit 8e0a45a
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Jul 16 23:17:54 2017 -0400

        Make sure babel is patched

    commit 356876f
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Jul 16 23:07:37 2017 -0400

        @oigroup/babel-plugin-lightscript@2.3.0-0

    commit 571d6cd
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Jul 16 23:04:50 2017 -0400

        Pipe call ast transformation

        commit daf9a4d5846bd955bd547a2a3f8cb21f4d1ce5cb
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Jul 16 23:00:33 2017 -0400

            Pipe operator transformation

    commit fbc0be5
    Author: William C. Johnson <wcjohnson@oigroup.net>
    Date:   Sun Jul 16 20:48:26 2017 -0400

        Placeholder args

        commit 5fa8631
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Jul 16 20:42:22 2017 -0400

            Allow placeholder to be changed

        commit ee2f7a7
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Jul 16 20:20:23 2017 -0400

            Support rest/spread placeholder args

        commit cd625f1
        Author: William C. Johnson <wcjohnson@oigroup.net>
        Date:   Sun Jul 16 19:41:02 2017 -0400

            Initial placeholderArgs implementation + testing
  • Loading branch information
wcjohnson committed May 15, 2018
1 parent 0642260 commit 4edfbe0
Show file tree
Hide file tree
Showing 47 changed files with 372 additions and 162 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oigroup/babel-plugin-lightscript",
"version": "3.0.0",
"version": "3.1.0-alpha.2",
"description": "Compile LightScript to JavaScript.",
"main": "lib/index.js",
"engines": {
Expand All @@ -18,7 +18,7 @@
"homepage": "http://wcjohnson.github.io/lightscript",
"license": "MIT",
"dependencies": {
"@oigroup/babylon-lightscript": "3.0.0",
"@oigroup/babylon-lightscript": "3.1.0-alpha.2",
"@oigroup/lightscript-runtime": "^0.1.1",
"ast-loc-utils": "^1.1.0",
"babel-types": "^6.26.0",
Expand Down
6 changes: 6 additions & 0 deletions src/config.lsc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export getMetadata() -> {
defaultValue: "default"
stage: "1"
}
enhancedTry: {
description: "`try` expressions and pattern matching for `catch`. (HIGHLY EXPERIMENTAL. DO NOT USE IN PRODUCTION.)"
valueType: "boolean"
stage: "-50"
}
bangCall: {
description: "Call functions with paren-free syntax using `!`"
valueType: "boolean"
Expand Down Expand Up @@ -106,6 +111,7 @@ export getParserOpts(pluginOpts, initialParserOpts) ->
if pluginOpts?.placeholderArgs: plugins.push("syntacticPlaceholder")
if pluginOpts?.placeholder:
parserOpts.placeholder = pluginOpts.placeholder
if pluginOpts.enhancedTry: plugins.push("enhancedTry")

// TODO: watch upstream on pattern matching; default to their syntax when complete
// patternMatchingVersion = pluginOpts?.patternMatching or "v4"
Expand Down
19 changes: 0 additions & 19 deletions src/fixAst.lsc

This file was deleted.

5 changes: 1 addition & 4 deletions src/helpers/functions.lsc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ export addImplicitReturns(functionPath) ->
throw path.buildCodeFrameError("Ambiguous implicit `return` of multiple variables. " +
"Add an explicit `return` statement on the next line.")

if expr~isa("AwaitExpression"):
t.returnStatement(expr.argument)~atNode(expr)
else:
t.returnStatement(expr)~atNode(expr)
t.returnStatement(expr)~atNode(expr)

transformTails(
functionPath.get("body")
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/tails.lsc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export getTails(path, allowLoops) ->
add(path.get("finalizer"))
| ~isa("CatchClause"):
add(path.get("body"))
if node.cases:
for idx i in node.cases:
add(path.get(`cases.${i}.consequent`))
| ~isa("MatchStatement"):
for idx i in node.cases:
add(path.get(`cases.${i}.consequent`))
Expand Down
15 changes: 15 additions & 0 deletions src/helpers/variables.lsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import t, { isa } from '../types'

import getLoc from "ast-loc-utils/lib/getLoc"
import atLoc from 'ast-loc-utils/lib/placeAtLoc'
import atNode from 'ast-loc-utils/lib/placeAtNode'
import span from 'ast-loc-utils/lib/span'

export isSimple(refTarget) ->
Expand Down Expand Up @@ -92,3 +93,17 @@ export checkFalsePositiveReference(refPath) ->
false
else:
false

// Prevent a spread from being transformed by the safe-spread transform
export spreadIsAlreadySafe(spread) ->
spread._safe = true
spread

// Convert function args from rest to spread
export restToSpread(argList) ->
[...for elem arg in argList:
if arg~isa("RestElement"):
t.spreadElement(arg.argument)~atNode(arg)~spreadIsAlreadySafe!
else:
arg
]
44 changes: 15 additions & 29 deletions src/lscNodeTypes.lsc
Original file line number Diff line number Diff line change
Expand Up @@ -287,36 +287,22 @@ export registerLightscriptNodeTypes(t): void ->
},
});

if not t.hasType("CatchExpression"):
definePluginType("CatchExpression", {
builder: ["expression", "cases"],
visitor: ["expression", "cases"],
if not t.hasType("TryExpression"):
definePluginType("TryExpression", {
builder: ["block", "handler", "finalizer"],
visitor: ["block", "handler", "finalizer"],
aliases: ["Expression"],
fields: {
expression: {
validate: assertNodeType("Expression")
block: {
validate: assertNodeType("Expression", "BlockStatement"),
},
cases: {
validate: chain(assertValueType("array"), assertEach(assertNodeType("CatchCase")))
}
}
});

if not t.hasType("CatchCase"):
definePluginType("CatchCase", {
builder: ["atoms", "binding", "consequent"],
visitor: ["atoms", "binding", "consequent"],
fields: {
atoms: {
validate: chain(assertValueType("array"), assertEach(assertNodeType("Expression")))
optional: true
}
binding: {
validate: assertNodeType("Identifier", "ArrayPattern", "ObjectPattern")
optional: true
}
consequent: {
validate: assertNodeType("Expression", "Statement")
}
}
handler: {
optional: true,
validate: assertNodeType("CatchClause"),
},
finalizer: {
optional: true,
validate: assertNodeType("BlockStatement"),
},
},
});
14 changes: 0 additions & 14 deletions src/pipe.lsc

This file was deleted.

71 changes: 0 additions & 71 deletions src/placeholders.lsc

This file was deleted.

10 changes: 3 additions & 7 deletions src/transforms/classes.lsc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import t, { is } from '../types'

// prevent generated spreadexpr from being further transformed
safe(node) ->
node._safe = true
node
import { restToSpread, spreadIsAlreadySafe } from '../helpers/variables'

// Check if the given path or any of its descendants contains a `super()`
// call expression.
Expand Down Expand Up @@ -57,7 +53,7 @@ export ensureConstructor(classPath, constructorBodyPath, withSuper = true) ->
t.expressionStatement(
t.callExpression(
t.super()
constructorBodyPath.parentPath.node.params
constructorBodyPath.parentPath.node.params~restToSpread!
)
)
else:
Expand All @@ -66,7 +62,7 @@ export ensureConstructor(classPath, constructorBodyPath, withSuper = true) ->
constructorBodyPath.parentPath.node.params = [t.restElement(argsUid)];
t.expressionStatement(
t.callExpression(t.super(), [
t.spreadElement(argsUid)~safe!
t.spreadElement(argsUid)~spreadIsAlreadySafe!
])
)

Expand Down
106 changes: 106 additions & 0 deletions src/transforms/try.lsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import t, { isa } from '../types'
import { transformTails } from '../helpers/tails'
import { toBlockStatement } from '../helpers/blocks'

import {
getLoc, placeAtLoc as atLoc, placeAtNode as atNode,
getSurroundingLoc, span, traverse,
placeTreeAtLocWhenUnplaced as allAtLoc
} from 'ast-loc-utils'

normalizeTryStatement(node, path): void ->
// Turn stuff into blocks as needed
if node.block: node.block = node.block~toBlockStatement()
if node.handler?.body: node.handler.body = node.handler.body~toBlockStatement()
if node.finalizer: node.finalizer = node.finalizer~toBlockStatement()
// Paramless handler gets a default param
if node.handler and (not node.handler.param):
node.handler.param = path.scope.generateUidIdentifier("err")
// Generate default handler
if (not node.handler) and (not node.finalizer):
errId = path.scope.generateUidIdentifier("err")
node.handler = t.catchClause(
errId,
t.blockStatement([t.expressionStatement(errId)])
)

transformVarDeclTryExpression(path, tryExprPath): void ->
{ node } = tryExprPath

// Starting from `const x = try ...`
// Add `let _val`
// let _val
// const x = try ...
resRef = path.scope.generateUidIdentifier("val")
path.insertBefore! t.variableDeclaration("let", [t.variableDeclarator(resRef)])

// replace `try ...` with `_val`
// let _val
// const x = _val
declaratorPath = path.get("declarations.0")
declaratorPath.node.init = resRef

// Turn the original node into a try statement and add it before the decl
// let _val
// try ...
// const x = _val
node.type = "TryStatement"
normalizeTryStatement(node, tryExprPath)
path.insertBefore! node

// Re-tail the `try` statement so it assigns its final value to `_val`
tryPath = path.getPrevSibling()
transformTails(tryPath, false, false, (node) ->
t.assignmentExpression("=", resRef, node)~atNode(node)
)

transformPessimizedTryExpression(path): void ->
{ node } = path

// If there are any awaits beneath us, we need async.
let needsAsync = false
path.traverse({
noScope: true

Function(path): void -> path.skip()

AwaitExpression(awaitPath) ->
now needsAsync = true
awaitPath.stop()

YieldExpression(yieldPath) ->
throw yieldPath.buildCodeFrameError("`yield` is not allowed in `try` expressions.")

ReturnStatement(returnPath) ->
throw returnPath.buildCodeFrameError("`return` is not allowed in `try` expressions.");
})

node.type = "TryStatement"
normalizeTryStatement(node, path)

iife = t.callExpression(
t.arrowFunctionExpression(
[]
t.blockStatement([node])
needsAsync
)
[]
)

path.replaceWith(iife)

isVarDeclTryExpr(path) ->
path.parent~isa("VariableDeclarator")
and path.parentPath.parent.declarations.length == 1
and path.parentPath.parentPath.listKey == "body"

export transformTryExpression(path, isLinter): void ->
if path~isVarDeclTryExpr!:
transformVarDeclTryExpression(path.parentPath.parentPath, path, isLinter)
else:
transformPessimizedTryExpression(path, isLinter)

export transformTryStatement(path): void ->
{ node } = path
normalizeTryStatement(node, path)
path.replaceWith(node)
Loading

0 comments on commit 4edfbe0

Please sign in to comment.