mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-09 15:47:55 -05:00
ES6 rest parameters test (#2516)
* ES6 rest parameters test * Modify 'config-all.json' for adding "es6/rest-parameters" * Indentation format * Add caniuse tag * Add spec link
This commit is contained in:
27
feature-detects/es6/rest-parameters.js
Normal file
27
feature-detects/es6/rest-parameters.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*!
|
||||
{
|
||||
"name": "ES6 Rest parameters",
|
||||
"property": "restparameters",
|
||||
"notes": [{
|
||||
"name": "ECMAScript 6 language specification",
|
||||
"href": "https://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions"
|
||||
}],
|
||||
"caniuse": "rest",
|
||||
"authors": ["dabretin"],
|
||||
"tags": ["es6"]
|
||||
}
|
||||
!*/
|
||||
/* DOC
|
||||
Check if browser implements ECMAScript 6 Rest parameters per specification.
|
||||
*/
|
||||
define(['Modernizr'], function(Modernizr) {
|
||||
Modernizr.addTest('restparameters', function() {
|
||||
try {
|
||||
// eslint-disable-next-line
|
||||
eval('function f(...rest) {}');
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@@ -177,6 +177,7 @@
|
||||
"es6/promises",
|
||||
"es6/string",
|
||||
"es6/symbol",
|
||||
"es6/rest-parameters",
|
||||
"es6/string-template",
|
||||
"es6/spread-array",
|
||||
"es7/array",
|
||||
|
||||
Reference in New Issue
Block a user