-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Want to undefine some built-in functions #13508
Comments
This is related to #4183 |
Global declarations are all originating from declaration files. The library file ( |
The ability is important for me to remove built-in function declarations, which is a little different from #4183. I need to operate with many DOM APIs so |
if you want to change the built in APIs, you can. You can start with removing two, or more, up to you. |
I want a keyword
undeclare
on declaredinterface/class
methods andvar
which works where it's referenced. It will benefit developers who wants stricter constraints.Syntactic
It should be like these:
And the declaration after
undeclare
should be strictly matched:var
/class
/namespace
/interface
isundeclare
-ed, then only remove one record with the given typefunction
is undeclared, types of args and its returned value should be strictly matched.Motivation
Many EcmaScript functions are generic for backward compatibility and usability, but developers may have their own programming standard, and only want limited usages. For example:
script-src: 'self'
limitssetTimeout
and refuseseval
.deprecated
and replaced by new ones.chrome.tabs.Tab
andtab.title
is notstring | undefined
butstring
.In my tests,
I'm able to override definitions of member variables, so there has been a work-around for cases like(edit: it reported "All declarations of 'title' must have identical modifiers"), but I can not find any way to removetab.title
function
definitions.The text was updated successfully, but these errors were encountered: