Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix #3577 Un-break require('sys')
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 28, 2012
1 parent 3ea2a61 commit f2a9ed4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion lib/sys.js
@@ -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

@Sannis
Copy link

@Sannis Sannis commented on f2a9ed4 Jun 28, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without any message about deprecation status, really? :(

@isaacs
Copy link
Author

@isaacs isaacs commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link

@x3ro x3ro commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Sannis
Copy link

@Sannis Sannis commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@isaacs
Copy link
Author

@isaacs isaacs commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@Sannis
Copy link

@Sannis Sannis commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

@isaacs
Copy link
Author

@isaacs isaacs commented on f2a9ed4 Jun 29, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tj
Copy link

@tj tj commented on f2a9ed4 Jun 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im +1 with who cares

@samitny
Copy link

@samitny samitny commented on f2a9ed4 Jul 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.