-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split ES5 shim/sham tests into separate tests
boolean results also now consistent with other tests
- Loading branch information
1 parent
0d74ccc
commit 25d892f
Showing
6 changed files
with
146 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*! | ||
{ | ||
"name": "ES5 Array", | ||
"property": "es5array", | ||
"notes": [{ | ||
"name": "ES5 Shim documentation", | ||
"href": "https://github.com/kriskowal/es5-shim" | ||
}, { | ||
"name": "ECMAScript 5.1 Language Specification", | ||
"href": "http://www.ecma-international.org/ecma-262/5.1/" | ||
}], | ||
"async": false, | ||
"authors": ["Ron Waldon (@jokeyrhyme)"], | ||
"knownBugs": [], | ||
"tags": [] | ||
} | ||
!*/ | ||
/* DOC | ||
Check if browser implements ECMAScript 5 Array per specification. | ||
*/ | ||
define(['Modernizr'], function (Modernizr) { | ||
// es5array | ||
// test by @jokeyrhyme | ||
Modernizr.addTest('es5array', function () { | ||
return Array.prototype && | ||
Array.prototype.every && | ||
Array.prototype.filter && | ||
Array.prototype.forEach && | ||
Array.prototype.indexOf && | ||
Array.prototype.lastIndexOf && | ||
Array.prototype.map && | ||
Array.prototype.some && | ||
Array.prototype.reduce && | ||
Array.prototype.reduceRight && | ||
Array.isArray; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*! | ||
{ | ||
"name": "ES5 Date", | ||
"property": "es5date", | ||
"notes": [{ | ||
"name": "ES5 Shim documentation", | ||
"href": "https://github.com/kriskowal/es5-shim" | ||
}, { | ||
"name": "ECMAScript 5.1 Language Specification", | ||
"href": "http://www.ecma-international.org/ecma-262/5.1/" | ||
}], | ||
"async": false, | ||
"authors": ["Ron Waldon (@jokeyrhyme)"], | ||
"knownBugs": [], | ||
"tags": [] | ||
} | ||
!*/ | ||
/* DOC | ||
Check if browser implements ECMAScript 5 Date per specification. | ||
*/ | ||
define(['Modernizr'], function (Modernizr) { | ||
// es5date | ||
// test by @jokeyrhyme | ||
Modernizr.addTest('es5date', function () { | ||
var isoDate = '2013-04-12T06:06:37.307Z', | ||
canParseISODate = false; | ||
try { | ||
canParseISODate = !!Date.parse(isoDate); | ||
} catch (e) { | ||
// no ISO date parsing yet | ||
} | ||
return Date.now && | ||
Date.prototype && | ||
Date.prototype.toISOString && | ||
Date.prototype.toJSON && | ||
canParseISODate; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*! | ||
{ | ||
"name": "ES5 Function", | ||
"property": "es5function", | ||
"notes": [{ | ||
"name": "ES5 Shim documentation", | ||
"href": "https://github.com/kriskowal/es5-shim" | ||
}, { | ||
"name": "ECMAScript 5.1 Language Specification", | ||
"href": "http://www.ecma-international.org/ecma-262/5.1/" | ||
}], | ||
"async": false, | ||
"authors": ["Ron Waldon (@jokeyrhyme)"], | ||
"knownBugs": [], | ||
"tags": [] | ||
} | ||
!*/ | ||
/* DOC | ||
Check if browser implements ECMAScript 5 Function per specification. | ||
*/ | ||
define(['Modernizr'], function (Modernizr) { | ||
// es5function | ||
// test by @jokeyrhyme | ||
Modernizr.addTest('es5function', function () { | ||
return Function.prototype && Function.prototype.bind; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*! | ||
{ | ||
"name": "ES5 String", | ||
"property": "es5string", | ||
"notes": [{ | ||
"name": "ES5 Shim documentation", | ||
"href": "https://github.com/kriskowal/es5-shim" | ||
}, { | ||
"name": "ECMAScript 5.1 Language Specification", | ||
"href": "http://www.ecma-international.org/ecma-262/5.1/" | ||
}], | ||
"async": false, | ||
"authors": ["Ron Waldon (@jokeyrhyme)"], | ||
"knownBugs": [], | ||
"tags": [] | ||
} | ||
!*/ | ||
/* DOC | ||
Check if browser implements ECMAScript 5 String per specification. | ||
*/ | ||
define(['Modernizr'], function (Modernizr) { | ||
// es5string | ||
// test by @jokeyrhyme | ||
Modernizr.addTest('es5string', function () { | ||
return String.prototype && String.prototype.trim; | ||
}); | ||
}); |