This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix #3577 Un-break require('sys')

  • Loading branch information...
1 parent 3ea2a61 commit f2a9ed487369ab7222522e1097708550adbe165c @isaacs isaacs committed Jun 28, 2012
Showing with 24 additions and 1 deletion.
  1. +24 −1 lib/sys.js
View
@@ -1 +1,24 @@
-throw new Error('The "sys" module is now called "util".');
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// the sys module was renamed to 'util'.
+// this shim remains to keep old programs working.
+module.exports = require('util');

9 comments on commit f2a9ed4

Without any message about deprecation status, really? :(

@Sannis What is the argument for a warning? Why does this ever need to be removed, as long as even one program is relying on it?

Who cares, really?

x3ro replied Jun 29, 2012

Why does this ever need to be removed, as long as even one program is relying on it?

That must be what the PHP developers where thinking when they decided to not remove gzgetss. Just saying ;)

@isaacs previous v0.6-v0.7 prints warning, so new behaviour may disappointing users that sys will be available for a long time now. If you do not care about this, let stay current variant, ok.

@Sannis I don't think anyone's going to really be too upset by the warning going away. If they are, we can add a ./configure option that puts the warning back ;P

If they are, we can add a ./configure option that puts the warning back ;P

I support this idea if you are serious. If not, that is not a problem for myself to wrote sys-should-throw module to use in my own projects :trollface:

tj replied Jun 29, 2012

im +1 with who cares

I think it should be eventually removed because the API has changed. Isn't that enough of a reason?

Having a warning would ensure that most repositories will eventually replace it.

I think it's a good balance between ensuring users keep up with node's API while not breaking their code in the process.

Please sign in to comment.