Skip to content

Commit

Permalink
Build: Acknowledge Android 2.3 is not ES5-compatible
Browse files Browse the repository at this point in the history
Android 2.3 chokes on unquoted reserved words being used as property names
which was making Deferred tests not run.

Acknowledge the sad fact that Android 2.3 is not ES5-compliant browser
and enable the "es3" option in JSHint config.

Fixes gh-2478
Closes gh-2481
  • Loading branch information
mgol committed Jul 20, 2015
1 parent bf591fb commit 1c59b30
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/.jshintrc
Expand Up @@ -12,8 +12,11 @@


"sub": true, "sub": true,


"es3": true,

"globals": { "globals": {
"window": true, "window": true,
"JSON": false,


"jQuery": true, "jQuery": true,
"define": true, "define": true,
Expand Down
3 changes: 3 additions & 0 deletions test/.jshintrc
Expand Up @@ -10,6 +10,8 @@
"undef": true, "undef": true,
"unused": true, "unused": true,


"es3": true,

"evil": true, "evil": true,
"sub": true, "sub": true,


Expand All @@ -21,6 +23,7 @@
"require": false, "require": false,
"define": false, "define": false,
"DOMParser": false, "DOMParser": false,
"JSON": false,
"Promise": false, "Promise": false,
"Symbol": false, "Symbol": false,
"QUnit": false, "QUnit": false,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core.js
Expand Up @@ -1400,7 +1400,7 @@ test("jQuery.parseJSON", function() {
deepEqual( deepEqual(
jQuery.parseJSON( "{ \"string\": \"\", \"number\": 4.2e+1, \"object\": {}," + jQuery.parseJSON( "{ \"string\": \"\", \"number\": 4.2e+1, \"object\": {}," +
"\"array\": [[]], \"boolean\": [ true, false ], \"null\": null }"), "\"array\": [[]], \"boolean\": [ true, false ], \"null\": null }"),
{ string: "", number: 42, object: {}, array: [[]], boolean: [ true, false ], "null": null }, { string: "", number: 42, object: {}, array: [[]], "boolean": [ true, false ], "null": null },
"Dictionary of all data types" "Dictionary of all data types"
); );


Expand Down
2 changes: 1 addition & 1 deletion test/unit/css.js
Expand Up @@ -1225,7 +1225,7 @@ test( "Do not throw on frame elements from css method (#15098)", 1, function() {
if ( transformName ) { if ( transformName ) {
equal( elemStyle[ transformName ], transformVal, "setting properly-prefixed transform" ); equal( elemStyle[ transformName ], transformVal, "setting properly-prefixed transform" );
} }
equal( elemStyle.undefined, undefined, "Nothing writes to node.style.undefined" ); equal( elemStyle[ "undefined" ], undefined, "Nothing writes to node.style.undefined" );
} ); } );


test( "Don't detect fake set properties on a node when caching the prefixed version", function() { test( "Don't detect fake set properties on a node when caching the prefixed version", function() {
Expand Down
8 changes: 4 additions & 4 deletions test/unit/deferred.js
Expand Up @@ -172,7 +172,7 @@ test( "jQuery.Deferred.catch", function( assert ) {


var value1, value2, value3, var value1, value2, value3,
defer = jQuery.Deferred(), defer = jQuery.Deferred(),
piped = defer.catch(function( a, b ) { piped = defer[ "catch" ](function( a, b ) {
return a * b; return a * b;
}), }),
done = jQuery.map( new Array( 3 ), function() { return assert.async(); } ); done = jQuery.map( new Array( 3 ), function() { return assert.async(); } );
Expand All @@ -186,18 +186,18 @@ test( "jQuery.Deferred.catch", function( assert ) {
value2 = b; value2 = b;
}); });


defer.reject( 2, 3 ).catch(function() { defer.reject( 2, 3 )[ "catch" ](function() {
assert.strictEqual( value1, 2, "first reject value ok" ); assert.strictEqual( value1, 2, "first reject value ok" );
assert.strictEqual( value2, 3, "second reject value ok" ); assert.strictEqual( value2, 3, "second reject value ok" );
assert.strictEqual( value3, 6, "result of filter ok" ); assert.strictEqual( value3, 6, "result of filter ok" );
done.pop().call(); done.pop().call();
}); });


jQuery.Deferred().resolve().catch(function() { jQuery.Deferred().resolve()[ "catch" ](function() {
assert.ok( false, "then should not be called on resolve" ); assert.ok( false, "then should not be called on resolve" );
}).then( done.pop() ); }).then( done.pop() );


jQuery.Deferred().reject().catch( jQuery.noop ).done(function( value ) { jQuery.Deferred().reject()[ "catch" ]( jQuery.noop ).done(function( value ) {
assert.strictEqual( value, undefined, "then fail callback can return undefined/null" ); assert.strictEqual( value, undefined, "then fail callback can return undefined/null" );
done.pop().call(); done.pop().call();
}); });
Expand Down
2 changes: 1 addition & 1 deletion test/unit/effects.js
Expand Up @@ -1579,7 +1579,7 @@ test("Initial step callback should show element as :animated (#14623)", 1, funct
var foo = jQuery( "#foo" ); var foo = jQuery( "#foo" );


foo.animate({ foo.animate({
opacity: 0, opacity: 0
}, { }, {
duration: 100, duration: 100,
step: function() { step: function() {
Expand Down

0 comments on commit 1c59b30

Please sign in to comment.