Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Draft saved
Draft discarded
Cancel
5
  • 1
    It should be possible but it doesn't seem like a good idea. If this is already confusing in JS with one prototype, imagine with two... Commented Mar 8, 2013 at 3:14
  • 1
    First, you don't have access to load or get directly from main. You would have access from its .prototype, or from an instance created by invoking main with new. Second, You can put .get on main.prototype, but there'll be no special relationship between instance from get and instances from main. Commented Mar 8, 2013 at 3:19
  • why do you want to do it? Commented Mar 8, 2013 at 3:27
  • I want to do it so that it looks nice when someone is looking at the code. I think main.get.registration() looks nicer than main.prototype.get.prototype.registration() Commented Mar 8, 2013 at 3:35
  • @elclanrs—this has nothing to do with prototypes or inheritance, its value is set by the call and is never resolved on the [[Prototype]] chain. It's resolved on the scope chain (very quickly since it's local). Commented Mar 8, 2013 at 4:00

lang-js

AltStyle によって変換されたページ (->オリジナル) /