1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:25:07 +00:00
serenity/Libraries/LibJS/Tests/builtins/Array
Linus Groh dca9e4ec10 LibJS: Implement rules for duplicate function parameters
- A regular function can have duplicate parameters except in strict mode
  or if its parameter list is not "simple" (has a default or rest
  parameter)
- An arrow function can never have duplicate parameters

Compared to other engines I opted for more useful syntax error messages
than a generic "duplicate parameter name not allowed in this context":

    "use strict"; function test(foo, foo) {}
                                     ^
    Uncaught exception: [SyntaxError]: Duplicate parameter 'foo' not allowed in strict mode (line: 1, column: 34)

    function test(foo, foo = 1) {}
                       ^
    Uncaught exception: [SyntaxError]: Duplicate parameter 'foo' not allowed in function with default parameter (line: 1, column: 20)

    function test(foo, ...foo) {}
                          ^
    Uncaught exception: [SyntaxError]: Duplicate parameter 'foo' not allowed in function with rest parameter (line: 1, column: 23)

    (foo, foo) => {}
          ^
    Uncaught exception: [SyntaxError]: Duplicate parameter 'foo' not allowed in arrow function (line: 1, column: 7)
2020-10-25 12:56:02 +01:00
..
array-basic.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-length-setter.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-shrink-during-find-crash.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
array-simple-and-generic-storage-initialization.js LibJS: Add tests for issue #3382 2020-09-01 21:35:59 +02:00
array-spread.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.from.js LibJS: Implement basic functionality of Array.from() 2020-08-17 21:23:11 +02:00
Array.isArray.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.of.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype-generic-functions.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.concat.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.every.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.fill.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.filter.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.find.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.findIndex.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.forEach.js LibJS: Implement rules for duplicate function parameters 2020-10-25 12:56:02 +01:00
Array.prototype.includes.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.indexOf.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.join.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.lastIndexOf.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.map.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.pop.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.push.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reduce.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reduceRight.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.reverse.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.shift.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.slice.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.some.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.splice.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.toLocaleString.js LibJS: Add Number.prototype.toString 2020-07-15 18:24:55 +02:00
Array.prototype.toString.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.unshift.js LibJS: Convert Array tests to new testing framework 2020-07-06 23:40:35 +02:00
Array.prototype.values.js Everywhere: Fix typos 2020-10-02 16:03:17 +02:00