Skip to main content

Bug Tracker

Side navigation

#13566 closed bug (fixed)

Opened March 05, 2013 01:55PM UTC

Closed April 04, 2013 08:55PM UTC

Last modified April 04, 2013 09:27PM UTC

v2.0.0b2 is not compatible for earlier versions on Node

Reported by: Owned by: rwaldron
Priority: low Milestone: None
Component: core Version: 2.0b2
Keywords: Cc:
Blocked by: Blocking:

Please see L:8668 and L:8690 in the 2.0.0b2.

Unfortunately some compatibility is lost although I think it's awesome implement supporting Node module pattern.

I'm using jQuery on Node with jsdom. This architecture works well 1.9.1, 2.0.0b1 but doesn't work 2.0.0bx.

I have 2 requirements written below:

(1) L:8690

Please use "window" substitute for "this".

(2) L:8668

add condition " && typeof process == 'undefined'" so that Node process is not return true in this "if" condition

How is it?

Attachments (0)
Change History (9)

Changed March 05, 2013 01:57PM UTC by rwaldron comment:1

I'm going to ping Isaac S on this

Changed March 05, 2013 05:24PM UTC by isaacs comment:2

I think the solution here is to skip the Node-style stuff if typeof window === 'object', so that Browser-emulators can get the Browser-style result, even in Node.

Changed March 05, 2013 09:56PM UTC by ystk_skm ( comment:3


thank you for your suggestion.

Please give attention to that I know some Browser-emulators in Node returns typeof window === 'object' true.

And the matter of here that the compatibility problem is not resolved.

Changed March 10, 2013 04:31AM UTC by isaacs comment:4

Yeah, on further consideration, I think that this is just something that jQuery should not fix. The major version number is getting incremented to 2.0, so it's a good time to make some breaking changes.

Browser emulators in Node can run the "client" code in such a way that module and module.exports are not exposed, using the built-in vm module. This is an easy workaround, and probably the correct approach anyway.

Changed March 10, 2013 07:03AM UTC by ystk_skm <> comment:5


I understand your guidance for Browser emulation on Node.

I know that it's time to make some breaking changes for jQuery, but, I cannot understand why these 2 fundamental specification changing which may cause unexpected error is necessary.

Could you explain why you think that this is just something that jQuery should not fix.

Changed March 13, 2013 01:28AM UTC by timmywil comment:6

component: unfiledcore
priority: undecidedlow
status: newopen
version: git2.0b2

Changed April 04, 2013 08:44PM UTC by rwaldron comment:7

owner: → rwaldron
status: openassigned

Changed April 04, 2013 08:55PM UTC by Rick Waldron comment:8

resolution: → fixed
status: assignedclosed

Fixes #13566. If there is a window object, define jQuery and $

Signed-off-by: Rick Waldron <>

Changeset: 37c801eda5a96ba8d58f3d8751c42df296d3bd39

Changed April 04, 2013 09:27PM UTC by Rick Waldron comment:9

Fixes #13566. If there is a window object, and it has a document property, it might be the window we want, so define jQuery and $. Thanks to @dcherman for saving us from that embarrassment!

Signed-off-by: Rick Waldron <>

Changeset: 6358da8aa32e7ed52da3af1a912bdd1a05863faf