Commit b2331319 authored by Julien Gilli's avatar Julien Gilli
Browse files

src: fix builtin modules failing with --use-strict

Currently, lib/_tls_legacy.js and lib/crypto.js cannot be loaded when
--use-strict is passed to node. In addition to that, console.trace
throws because it uses arguments.callee.

This change fixes these issues and adds a test that makes sure
every external built-in module can be loaded with require when
--use-strict is enabled.

Please note that this change does not fix all issues with built-in
modules' code running with --use-strict. It is very likely that some
code in the built-in modules still fails when passing this flag.

However, fixing all code would require us to enable strict mode by
default in all builtins modules, which would certainly break existing
applications.

Fixes #9187.

PR: #9237
PR-URL: https://github.com/joyent/node/pull/9237


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent 3e40e126
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment