vengeful-god

2.0.0 • Public • Published

Are you paranoid, do you want some slightly saner rules for JS?

Do you wish to punish those who do not have sane type coercion going on? Do you wish to punish those who try to use eval locally?

Well this is the globally monkey-punching module for you!

  • The global object is frozen. No accidental globals allowed.
  • eval will only run in the global scope, implicit returns still work
  • Function will only accept a single argument, use arguments instead of named parameters if you use Function
  • No type coercion for builtin types, use String() / Number() instead.
  • .valueOf during coercion or Number() will not be allowed to return NaN.
  • .valueOf must return a string or number during coercion.
  • .toString must return a string during coercion.
  • Somewhat informative messages on failed coercion
  • Object.prototype is set to not have any properties
  • Builtin prototypes are frozen, as are constructors
  • throws on Object.setPrototypeOf()
  • throws on .__proto__
  • throws on Boolean, Number, and String constructors from creating object wrappers (new Boolean), allows extend still
  • throws on Boolean, Number, and String constructors odd behavior for ctor.call(primitive), ctor(), and ctor(more, than, one, arg)

Readme

Keywords

none

Package Sidebar

Install

npm i vengeful-god

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • bradleymeck