Skip to content

Functions tests would benefit from a helper like verifyNoRestrictedFunctionProperties #4378

Open
@gibson042

Description

@gibson042

Originally posted by @gibson042 in #4355 (comment)

I think we should modernize [test/built-ins/Function/StrictFunction_restricted-properties.js] as well, introducing a helper like verifyNoRestrictedFunctionProperties and using it at e.g.

  • test/language/expressions/{arrow-function,async-arrow-function,async-function,async-generator,class,function,generators}/{restricted-properties,restricted-properties-module}.js (covering expressions like var f = function(){}; and generalizations, in script and module code)
  • test/language/statements/{async-function,async-generator,class,function,generators}/restricted-properties.js (covering statements like function f(){} and generalizations, in script and module code)
  • test/language/statements/class/definition/{methods-restricted-properties,methods-restricted-properties-module}.js (covering methods like var m = new (class { m(){} })().m, in script and module code)
    • likewise somewhere for generalizations—class static methods, object literal methods, and syntactic get/set accessors
  • test/built-ins/{AsyncFunction,AsyncGeneratorFunction,Function,GeneratorFunction}/instance-restricted-properties.js (each covering both $Function() and $Function('"use strict"'), or alternatively split into a pair of files)
  • test/built-ins/Function/prototype/bind/instance-restricted-properties.js

and removing all other restricted-properties files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions