Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

global function declaration onGlobalPostMessage causes syntax errors when "use strict" added #418

Closed
benlesh opened this issue Dec 3, 2014 · 2 comments

Comments

@benlesh
Copy link
Contributor

benlesh commented Dec 3, 2014

DISCLAIMER: I realize this might be more of an issue with the way another library is using this. I'll create an issue there as well, but it's a fairly trivial fix.

I'm developing using EmberJS and RxJS using Ember-CLI. Ember-CLI as a process by which it makes libraries added via Bower available through ES6 module imports by looking import Rx from "bower_components/rxjs/dist/rx.all"; and importing that into a file that sets it up with the require container.

Long story short, it adds "use strict"; inside of that:

define("bower_components/rxjs/dist/rx.all", 
  [],
  function() {
    "use strict";
    // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

    ;(function (undefined) {

      var objectTypes = {
     /*.... you know the rest ...*/

use strict doesn't like the global function declaration for onGlobalPostMessage found here, which results in a Syntax Error that breaks RxJS for the app.

@benlesh
Copy link
Contributor Author

benlesh commented Dec 3, 2014

Screenshot of the syntax error from Chrome:

screen shot 2014-12-03 at 12 09 56 pm

@benlesh
Copy link
Contributor Author

benlesh commented Dec 3, 2014

Incidentally, I doesn't follow your style guide either.

I'm working on a PR.

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

No branches or pull requests

1 participant