Homec4science

Enable "strict" mode for NodeJS

Authored by Joshua Spence <josh@joshuaspence.com> on Jan 19 2015, 21:41.

Description

Enable "strict" mode for NodeJS

Summary:
In particular, this changes the behavior of NodeJS in the following ways:

  • Any attempt to get or modify the global object will result in an error.
  • null values of this will no longer be evaluated to the global object and primitive values of this will not be converted to wrapper objects.
  • Writing or deleting properties which have there writeable or configurable attributes set to false will now throw an error instead of failing silently.
  • Adding a property to an object whose extensible attribute is false will also throw an error now.
  • A functions arguments are not writeable so attempting to change them will now throw an error arguments = [...].
  • with(){} statements are gone.
  • Use of eval is effectively banned.
  • eval and arguments are not allowed as variable or function identifiers in any scope.
  • The identifiers implements, interface, let, package, private, protected, public, static and yield are all now reserved for future use (roll on ES6).

Test Plan: Verified that Aphlict was still functional.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11430

Details

Committed
Joshua Spence <josh@joshuaspence.com>Jan 19 2015, 21:43
Pushed
aubortJan 31 2017, 17:16
Parents
rPH00faa2b2f7b5: Fix mobile action menus in Phriction
Branches
Unknown
Tags
Unknown

Event Timeline

Joshua Spence <josh@joshuaspence.com> committed rPH53834d1471ad: Enable "strict" mode for NodeJS (authored by Joshua Spence <josh@joshuaspence.com>).Jan 19 2015, 21:43