ajaxorg/ace — Issue #628: Can't use jQuery 1.7+ with Ace in IE8
Author: JanMiksovsky
Created: 2012-01-23 18:31:54+00:00
State: open

To repro:
1. Load recent version of Ace and recent version of jQuery (e.g., 1.7.1).
2. Try to do a jQuery on() call to bind an event. Do not specify an event selector.

Result: The jQuery on() call fails.

Page showing this bug: http://quickui.org/sandbox.

As best as I can determine, ace/ace/lib/regexp.js rewrites the standard RegExp.exec() function to do some processing of its own. In IE8, this processing does not appear to handle the case where an undefined value is passed to exec(). If no selector is passed to the jQuery on() call, then Ace's rewritten RegExp.exec() handler dies with the error: "Unable to get value of the property 'slice': object is null or undefined".

It looks like regexp.js already has some fairly gnarly checking to handle browsers that don't return a simple undefined value. That checking seems to work in IE9, but is failing in IE8 (and probably earlier).