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:
David BRETIN
2020-03-19 21:20:01 +01:00
committed by GitHub
parent 46efd67df3
commit 49dc9d38e8
2 changed files with 28 additions and 0 deletions

View 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;
});
});

View File

@@ -177,6 +177,7 @@
"es6/promises",
"es6/string",
"es6/symbol",
"es6/rest-parameters",
"es6/string-template",
"es6/spread-array",
"es7/array",