Skip to main content

Bug Tracker

Side navigation

#15014 closed bug (invalid)

Opened April 14, 2014 04:25PM UTC

Closed April 30, 2014 08:57AM UTC

document variable got corrupted in jQuery1.11.0 (solution provided)

Reported by: Revin <caoyunbin001@126.com> Owned by: Revin <caoyunbin001@126.com>
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:
Description

I'm injecting jQuery1.11.0 to my ChromeEmbeddedFramework(CEF),

using OnContextCreated, and ExecuteJavaScript(code,"jQuery.js",0)

and I encountered this bug:

Uncaught TypeError: Cannot call method 'createElement' of undefined (at line 917)

after further investigation,

it appears that function assert(at line 917 of uncompressed jQuery 1.11.0)

uses var div = document.createElement("div");

and at this point, document is referring to undefined.

it can easily be fixed: just replace it with

var div = window.document.createElement("div");

here is the long version:

it's clearly that the bug exists inside jQuery itself:

add alert(document) to jQuery line 1 will show that document exists

and add alert(document) to jQuery line 917(right before the error)

will show that document is undefined!

weird though, add alert(window.document) to line 917 will show that

window.document exists

so there must be somewhere in the jQuery code(sorry TL;DR)

that corrupted the document variable.

Attachments (0)
Change History (2)

Changed April 15, 2014 12:59PM UTC by dmethvin comment:1

owner: → Revin <caoyunbin001@126.com>
status: newpending

We'll need a test case showing the problem. We're not going to make changes to the code on hearsay.

Changed April 30, 2014 08:57AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!