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

Ember.Object is undefined #12623

Closed
rondale-sc opened this issue Nov 17, 2015 · 14 comments · Fixed by #12636
Closed

Ember.Object is undefined #12623

rondale-sc opened this issue Nov 17, 2015 · 14 comments · Fixed by #12636
Assignees

Comments

@rondale-sc
Copy link
Contributor

Seems as if on canary Ember.Object is undefined. I discovered this when loading the following jsbin:

http://jsbin.com/qoyiyegava/edit?html,js,console

@rwjblue
Copy link
Member

rwjblue commented Nov 17, 2015

This is being caused by this line:

Mixin.prototype.toString = classToString;

In combination with sealing inside Mixin's init.

@rondale-sc
Copy link
Contributor Author

Was able to reduce the jsbin's complexity a bit and still show the issue:

http://jsbin.com/dipipe/2/edit?html,js,console,output

@rwjblue
Copy link
Member

rwjblue commented Nov 17, 2015

After more toying around with this, the issue is with the load order of modules.

Working Demo: http://jsbin.com/kijavi/edit?html,js,console
Failing Demo: http://jsbin.com/yebonov/edit?html,js,console


Working:

<script src="http://builds.emberjs.com/canary/ember.debug.js"></script>
<script src="http://builds.emberjs.com/canary/ember-template-compiler.js"></script>

Failing:

<script src="http://builds.emberjs.com/canary/ember-template-compiler.js"></script>
<script src="http://builds.emberjs.com/canary/ember.debug.js"></script>

@rwjblue
Copy link
Member

rwjblue commented Nov 17, 2015

Basically, if ember-template-compiler.js (which only includes ember-metal, and not runtime) is loaded first then ember-runtime modules are loaded and try to add toString property to Mixin after its init.

@rondale-sc
Copy link
Contributor Author

This wouldn't affect ember-cli applications then?

@rwjblue
Copy link
Member

rwjblue commented Nov 17, 2015

@rondale-sc - Correct.

@rondale-sc
Copy link
Contributor Author

Interesting. Is this a bug then? Globals still work if specified in the correct order. Should I close?

@rwjblue
Copy link
Member

rwjblue commented Nov 17, 2015

@rondale-sc - I am unsure. It is definitely not wonderful that what used to work now does not work.

@rondale-sc
Copy link
Contributor Author

True, but I'm not sure how you'd get the seal effect without order dependence.

@krisselden krisselden self-assigned this Nov 18, 2015
@krisselden
Copy link
Contributor

Honestly I think we should just drop this for Mixins, it is rare in the ember cli world to assign them to a Namespace.

@krisselden
Copy link
Contributor

@rwjblue do we strip 'use strict' in debug builds?

@krisselden
Copy link
Contributor

so, I understand now what is going on, I didn't catch this because debugSeal is normally a noop, it is the template compiler that makes it not a noop. I intended to do this, but I would have caught this error if the debug functions actually worked via the module import.

@rwjblue
Copy link
Member

rwjblue commented Nov 18, 2015

We strip use strict only on a small number of modules (5 I think?) as a work around to a nasty iOS bug.

@knownasilya
Copy link
Contributor

Is this a related bug? FirebaseExtended/emberfire#340

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

Successfully merging a pull request may close this issue.

4 participants