mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-20 16:41:04 +00:00
33 lines
868 B
JavaScript
33 lines
868 B
JavaScript
/*!
|
|
{
|
|
"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;
|
|
});
|
|
});
|