mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-19 06:36:15 +08:00
fix(specs): fix jQuery to jqLite binding on IE8
It appears that this whole time all IE8 unit tests ran only with jqLite. Due to a weird bug in IE[1], we never overwrote jqLite implementation with jQuery, so the tests ran with our jqLite instead. This affected only IE8 (and likely older) and only in unit testing mode. angular.js - the built artifact binds to jQuery just find. [1] https://plus.google.com/104744871076396904202/posts/Kqjuj6RSbbT
This commit is contained in:
@@ -39,6 +39,11 @@ describe('jqLite', function(){
|
||||
});
|
||||
|
||||
|
||||
it('should be jqLite when jqLiteMode is on, otherwise jQuery', function() {
|
||||
expect(jqLite).toBe(_jqLiteMode ? jqLiteWrap : _jQuery);
|
||||
});
|
||||
|
||||
|
||||
describe('construction', function(){
|
||||
it('should allow construction with text node', function(){
|
||||
var text = a.firstChild;
|
||||
|
||||
3
test/jquery_alias.js
vendored
3
test/jquery_alias.js
vendored
@@ -1,3 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
var _jQuery = jQuery;
|
||||
var _jQuery = jQuery,
|
||||
_jqLiteMode = false;
|
||||
|
||||
3
test/jquery_remove.js
vendored
3
test/jquery_remove.js
vendored
@@ -1,3 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
var _jQuery = jQuery.noConflict(true);
|
||||
var _jQuery = jQuery.noConflict(true),
|
||||
_jqLiteMode = true;
|
||||
|
||||
@@ -28,6 +28,14 @@ if (window.jstestdriver) {
|
||||
beforeEach(function(){
|
||||
// This is to reset parsers global cache of expressions.
|
||||
compileCache = {};
|
||||
|
||||
// workaround for IE bug https://plus.google.com/104744871076396904202/posts/Kqjuj6RSbbT
|
||||
// IE overwrite window.jQuery with undefined because of empty jQuery var statement, so we have to
|
||||
// correct this, but only if we are not running in jqLite mode
|
||||
if (!_jqLiteMode && _jQuery !== jQuery) {
|
||||
jQuery = _jQuery;
|
||||
}
|
||||
|
||||
// reset to jQuery or default to us.
|
||||
bindJQuery();
|
||||
jqLite(document.body).html('');
|
||||
|
||||
Reference in New Issue
Block a user