Page MenuHomePhabricator

Enable "strict" mode for NodeJS
ClosedPublic

Authored by joshuaspence on Jan 19 2015, 8:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 3:39 AM
Unknown Object (File)
Sun, Dec 8, 1:43 PM
Unknown Object (File)
Fri, Dec 6, 3:39 AM
Unknown Object (File)
Sat, Nov 23, 7:19 AM
Unknown Object (File)
Wed, Nov 20, 10:34 AM
Unknown Object (File)
Tue, Nov 19, 11:42 PM
Unknown Object (File)
Nov 13 2024, 6:42 AM
Unknown Object (File)
Oct 19 2024, 3:57 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP53834d1471ad: 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.

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3913
Build 3926: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Enable "strict" mode for NodeJS.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jan 19 2015, 8:40 PM
This revision was automatically updated to reflect the committed changes.