Skip to content
This repository
Browse code

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

  • Loading branch information...
commit f2a9ed487369ab7222522e1097708550adbe165c 1 parent 3ea2a61
Isaac Z. Schlueter authored

Showing 1 changed file with 24 additions and 1 deletion. Show diff stats Hide diff stats

  1. 25  lib/sys.js
25  lib/sys.js
... ...
@@ -1 +1,24 @@
1  
-throw new Error('The "sys" module is now called "util".');
  1
+// Copyright Joyent, Inc. and other Node contributors.
  2
+//
  3
+// Permission is hereby granted, free of charge, to any person obtaining a
  4
+// copy of this software and associated documentation files (the
  5
+// "Software"), to deal in the Software without restriction, including
  6
+// without limitation the rights to use, copy, modify, merge, publish,
  7
+// distribute, sublicense, and/or sell copies of the Software, and to permit
  8
+// persons to whom the Software is furnished to do so, subject to the
  9
+// following conditions:
  10
+//
  11
+// The above copyright notice and this permission notice shall be included
  12
+// in all copies or substantial portions of the Software.
  13
+//
  14
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  17
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  18
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  19
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
  21
+
  22
+// the sys module was renamed to 'util'.
  23
+// this shim remains to keep old programs working.
  24
+module.exports = require('util');

9 notes on commit f2a9ed4

Oleg Efimov

Without any message about deprecation status, really? :(

Isaac Z. Schlueter
Collaborator

@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?

Lucas Jenß
x3ro commented on f2a9ed4

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 ;)

Oleg Efimov

@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.

Isaac Z. Schlueter
Collaborator

@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

Oleg Efimov

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:

Isaac Z. Schlueter
Collaborator
TJ Holowaychuk

im +1 with who cares

Sam IT

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.
Something went wrong with that request. Please try again.