Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions tests would benefit from a helper like verifyNoRestrictedFunctionProperties #4378

Open
gibson042 opened this issue Jan 13, 2025 · 0 comments

Comments

@gibson042
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant