# Strong brand checking in JavaScript

**URL:** <https://es.discourse.group/t/strong-brand-checking-in-javascript/557>\
**Category:** 💡 Ideas\
**Created:** [November 23, 2020, 12:20pm UTC](https://es.discourse.group/t/strong-brand-checking-in-javascript/557 "2020-11-23T12:20:59Z")\
**Posts on this page:** 1\
**Showing post:** 51

<div class="post-metadata">

**Author:** ![rdking](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/rdking/32/54_2.png) [@rdking](https://es.discourse.group/u/rdking)\
**Post date:** [November 1, 2021, 6:58pm UTC](https://es.discourse.group/t/strong-brand-checking-in-javascript/557/51 "2021-11-01T18:58:35Z")

</div>

Incorrect. Just look at a potential stub for this kind of function that I posted in a different thread.

> [@'use initial' directive, for globalThis mutation protection](https://es.discourse.group/t/use-initial-directive-for-globalthis-mutation-protection/1061/9):
>
> Here's an even cleaner solution: provide an ES API function that allows a caller to disable other builtin API functions. By disable, I mean replace them with undefined or a function that throws. globalThis.disableAPI(owner, fnName) { let retval = owner.prototype[fnName]; function disabledFn() { throw new ReferenceError(`This function ('${fnName}') has been disabled.`); } function isOriginal(fn) { return !fn.name.startsWith('bound ') && fn.toString().endsWith('{ [native c…

The blocking function need only return originals of the functions it blocked. If that's not satisfactory, then just copy the references to the originating functions before blocking them. It's the same thing currently being done by modules wanting to deny other modules. The only difference is that there would be a way to do so provided by the engine, meaning it's no longer first come, first served. Instead, monkey patching and securing would be able to be handled separately.

---

_[View the full topic](https://es.discourse.group/t/strong-brand-checking-in-javascript/557)._
