Permalink
Browse files

Build: Acknowledge Android 2.3 is not ES5-compatible

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 19, 2015
1 parent bf591fb commit 1c59b308d201d6dd0f0aed2ad0256d01b9f68047
Showing with 13 additions and 7 deletions.
  1. +3 −0 src/.jshintrc
  2. +3 −0 test/.jshintrc
  3. +1 −1 test/unit/core.js
  4. +1 −1 test/unit/css.js
  5. +4 −4 test/unit/deferred.js
  6. +1 −1 test/unit/effects.js
View
@@ -12,8 +12,11 @@
"sub": true,
+ "es3": true,
+
"globals": {
"window": true,
+ "JSON": false,
"jQuery": true,
"define": true,
View
@@ -10,6 +10,8 @@
"undef": true,
"unused": true,
+ "es3": true,
+
"evil": true,
"sub": true,
@@ -21,6 +23,7 @@
"require": false,
"define": false,
"DOMParser": false,
+ "JSON": false,
"Promise": false,
"Symbol": false,
"QUnit": false,
View
@@ -1400,7 +1400,7 @@ test("jQuery.parseJSON", function() {
deepEqual(
jQuery.parseJSON( "{ \"string\": \"\", \"number\": 4.2e+1, \"object\": {}," +
"\"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"
);
View
@@ -1225,7 +1225,7 @@ test( "Do not throw on frame elements from css method (#15098)", 1, function() {
if ( transformName ) {
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() {
View
@@ -172,7 +172,7 @@ test( "jQuery.Deferred.catch", function( assert ) {
var value1, value2, value3,
defer = jQuery.Deferred(),
- piped = defer.catch(function( a, b ) {
+ piped = defer[ "catch" ](function( a, b ) {
return a * b;
}),
done = jQuery.map( new Array( 3 ), function() { return assert.async(); } );
@@ -186,18 +186,18 @@ test( "jQuery.Deferred.catch", function( assert ) {
value2 = b;
});
- defer.reject( 2, 3 ).catch(function() {
+ defer.reject( 2, 3 )[ "catch" ](function() {
assert.strictEqual( value1, 2, "first reject value ok" );
assert.strictEqual( value2, 3, "second reject value ok" );
assert.strictEqual( value3, 6, "result of filter ok" );
done.pop().call();
});
- jQuery.Deferred().resolve().catch(function() {
+ jQuery.Deferred().resolve()[ "catch" ](function() {
assert.ok( false, "then should not be called on resolve" );
}).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" );
done.pop().call();
});
View
@@ -1579,7 +1579,7 @@ test("Initial step callback should show element as :animated (#14623)", 1, funct
var foo = jQuery( "#foo" );
foo.animate({
- opacity: 0,
+ opacity: 0
}, {
duration: 100,
step: function() {

0 comments on commit 1c59b30

Please sign in to comment.