first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
/*!
{
"name": "ES5 Array",
"property": "es5array",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Array per specification.
*/
define(['Modernizr'], function(Modernizr) {
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);
});
});
+32
View File
@@ -0,0 +1,32 @@
/*!
{
"name": "ES5 Date",
"property": "es5date",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Date per specification.
*/
define(['Modernizr'], function(Modernizr) {
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);
});
});
+21
View File
@@ -0,0 +1,21 @@
/*!
{
"name": "ES5 Function",
"property": "es5function",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Function per specification.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('es5function', function() {
return !!(Function.prototype && Function.prototype.bind);
});
});
+33
View File
@@ -0,0 +1,33 @@
/*!
{
"name": "ES5 Object",
"property": "es5object",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim", "es5sham"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Object per specification.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('es5object', function() {
return !!(Object.keys &&
Object.create &&
Object.getPrototypeOf &&
Object.getOwnPropertyNames &&
Object.isSealed &&
Object.isFrozen &&
Object.isExtensible &&
Object.getOwnPropertyDescriptor &&
Object.defineProperty &&
Object.defineProperties &&
Object.seal &&
Object.freeze &&
Object.preventExtensions);
});
});
+32
View File
@@ -0,0 +1,32 @@
/*!
{
"name": "ES5",
"property": "es5",
"caniuse": "es5",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim", "es5sham"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements everything as specified in ECMAScript 5.
*/
define(['Modernizr', 'test/es5/array', 'test/es5/date', 'test/es5/function', 'test/es5/object', 'test/es5/strictmode', 'test/es5/string', 'test/json', 'test/es5/syntax', 'test/es5/undefined'], function(Modernizr) {
Modernizr.addTest('es5', function() {
return !!(
Modernizr.es5array &&
Modernizr.es5date &&
Modernizr.es5function &&
Modernizr.es5object &&
Modernizr.strictmode &&
Modernizr.es5string &&
Modernizr.json &&
Modernizr.es5syntax &&
Modernizr.es5undefined
);
});
});
+20
View File
@@ -0,0 +1,20 @@
/*!
{
"name": "ES5 Strict Mode",
"property": "strictmode",
"caniuse": "use-strict",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"authors": ["@kangax"],
"tags": ["es5"],
"builderAliases": ["es5_strictmode"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 Object strict mode.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('strictmode', (function() {'use strict'; return !this; })());
});
+21
View File
@@ -0,0 +1,21 @@
/*!
{
"name": "ES5 String",
"property": "es5string",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}],
"polyfills": ["es5shim"],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser implements ECMAScript 5 String per specification.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('es5string', function() {
return !!(String.prototype && String.prototype.trim);
});
});
+43
View File
@@ -0,0 +1,43 @@
/*!
{
"name": "ES5 Syntax",
"property": "es5syntax",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}, {
"name": "original implementation of detect code",
"href": "https://kangax.github.io/compat-table/es5/"
}],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"warnings": ["This detect uses `eval()`, so CSP may be a problem."],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser accepts ECMAScript 5 syntax.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('es5syntax', function() {
var value, obj, stringAccess, getter, setter, reservedWords, zeroWidthChars;
try {
/* eslint no-eval: "off" */
// Property access on strings
stringAccess = eval('"foobar"[3] === "b"');
// Getter in property initializer
getter = eval('({ get x(){ return 1 } }).x === 1');
eval('({ set x(v){ value = v; } }).x = 1');
// Setter in property initializer
setter = value === 1;
// Reserved words as property names
eval('obj = ({ if: 1 })');
reservedWords = obj['if'] === 1;
// Zero-width characters in identifiers
zeroWidthChars = eval('_\u200c\u200d = true');
return stringAccess && getter && setter && reservedWords && zeroWidthChars;
} catch (ignore) {
return false;
}
});
});
+32
View File
@@ -0,0 +1,32 @@
/*!
{
"name": "ES5 Immutable Undefined",
"property": "es5undefined",
"notes": [{
"name": "ECMAScript 5.1 Language Specification",
"href": "https://www.ecma-international.org/ecma-262/5.1/"
}, {
"name": "original implementation of detect code",
"href": "https://kangax.github.io/compat-table/es5/"
}],
"authors": ["Ron Waldon (@jokeyrhyme)"],
"tags": ["es5"]
}
!*/
/* DOC
Check if browser prevents assignment to global `undefined` per ECMAScript 5.
*/
define(['Modernizr'], function(Modernizr) {
Modernizr.addTest('es5undefined', function() {
var result, originalUndefined;
try {
originalUndefined = window.undefined;
window.undefined = 12345;
result = typeof window.undefined === 'undefined';
window.undefined = originalUndefined;
} catch (e) {
return false;
}
return result;
});
});