GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — doc: explain differences in console.assert between node and browsers by jasnell · Pull Request #6169 · nodejs/node Conversation
Member
Checklist
Affected core subsystem(s)doc, console Description of changeProvide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need a
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, the example is incomplete... just noticed... it should be: const myConsole = Object.setPrototypeOf({ assert(assertion, message, ...args) { try { console.assert(assertion, message, ...args); } catch (err) { console.error(err.stack); } } }, console); Essentially, this creates a simple extension of the existing console object without monkey-patching it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed the example in updated commit
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we should be encouraging such liberal use of setPrototypeOf. A lot of people have strong feelings against it and it sort of lumped in the language by mistake (it's a funny story really). If we are using it though, why not just:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure encouraging use of
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsProvide an example for implementing browser like behavior for console.assert. This "fixes" nodejs#5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: nodejs#5340
jasnell
force-pushed
the
doc-console-assert
branch
from
b74e791 to
4c5a6c3
Compare
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps a link to https://developer.mozilla.org/en-US/docs/Web/API/Console
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
jasnell
added a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
Closed
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
joelostrowski
pushed a commit
to joelostrowski/node
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" nodejs#5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: nodejs#5340 PR-URL: nodejs#6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
jasnell
added a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
MylesBorins
pushed a commit
that referenced
this pull request
Provide an example for implementing browser like behavior for console.assert. This "fixes" #5340 by providing an alternative to changing Node.js' implemented behavior. Instead, we document the differences and show how to work around them if browser like semantics are desired. Fixes: #5340 PR-URL: #6169 Reviewed-By: Robert Jefe Lindstädt <[email protected]> Reviewed-By: Jeff Harris <@techjeffharris>
Merged
4 tasks done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. console.assert throwing behaviour and Console objectUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |