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

Conversation

@TooTallNate
Copy link

Use the real versions of the Date and RegExp functions, from the
prototype. This defends against code like:

var d = new Date()
d.toUTCString = null
util.inspect(d)
  // TypeError: toUTCString is not a function

Or:

var r = /a regexp/
r.toString = null
util.inspect(r)
  // TypeError: Cannot convert object to primitive value

Use the *real* versions of the Date and RegExp functions, from the
prototype. This defends against code like:

  var d = new Date()
  d.toUTCString = null
  util.inspect(d)
    // TypeError: toUTCString is not a function
@TooTallNate
Copy link
Author

Added test cases.

@koichik koichik closed this in ebefe77 Oct 26, 2011
koichik pushed a commit that referenced this pull request Oct 26, 2011
@koichik
Copy link

koichik commented Oct 26, 2011

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants