Skip to content

IE11 SyntaxError #117

Description

@stellusUi

I seem to keep getting a SyntaxError in IE11 when using the minified version of this package (2.0.0).

It also happens when I minify it as part of my full library set as well.

The problem seems to be the comma before the this.createWebSocketBackend
throw new Error("Invalid url provided");return t?new a(e,t):new a(e)},this.createWebSocketBackend

The original source version doesn't seem to warrant a new comma from what I can tell (~Line 388)

  function $WebSocketBackendProvider($log) {
    this.create = function create(url, protocols) {
      var match = /wss?:\/\//.exec(url);

      if (!match) {
        throw new Error('Invalid url provided');
      }

      if (protocols) {
        return new Socket(url, protocols);
      }

      return new Socket(url);
    };

    this.createWebSocketBackend = function createWebSocketBackend(url, protocols) {
      $log.warn('Deprecated: Please use .create(url, protocols)');
      return this.create(url, protocols);
    };
  }

I'm using grunt-contrib-uglify@2.3.0 and can't seem to find a way to remove the comma using any of the UglifyJS2 compressor options.

https://github.com/mishoo/UglifyJS2#compressor-options

Thoughts welcomed.

Thanks in advance
ie-angular-websockets

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions