Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix "//# " crash with sourceMap directive #4

Closed
aMarCruz opened this issue Dec 11, 2018 · 1 comment
Closed

Prefix "//# " crash with sourceMap directive #4

aMarCruz opened this issue Dec 11, 2018 · 1 comment

Comments

@aMarCruz
Copy link
Owner

The use of '//# ' in prefixes (with an space) will crash on files with the '//# sourceMap=...' directive.

I will fix this issue ASAP.

@aMarCruz
Copy link
Owner Author

The issue was generated by TypeScript v3 in this fragment:

const _R = {
    // ...
    concat(routes: IRoute | IRoute[], cb?: EnterFn) {
      _deprecated('concat', 'add')
      return R.add(routes, cb)
    },

    //#if process.env.BUILD === 'test'
    _split,
    _normalize,
    //#endif
  }

TS output:

const _R = {
    // ...
    concat(routes: IRoute | IRoute[], cb?: EnterFn) {
      _deprecated('concat', 'add')
      return R.add(routes, cb)
    },

    //#if process.env.BUILD === 'test'
    _split,
    _normalize,
  }

Moving up the conditional block fixes the issue:

const _R = {
    // ...

    //#if process.env.BUILD === 'test'
    _split,
    _normalize,
    //#endif

    concat(routes: IRoute | IRoute[], cb?: EnterFn) {
      _deprecated('concat', 'add')
      return R.add(routes, cb)
    },
  }

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

No branches or pull requests

1 participant