-
Notifications
You must be signed in to change notification settings - Fork 26.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): tree shake dev mode error message #57035
Conversation
3e5875e
to
55c415b
Compare
55c415b
to
9567497
Compare
Adds an `ngDevMode` check before a runtime error message. Fixes angular#57034.
9567497
to
bf423ef
Compare
@@ -205,10 +206,10 @@ export function toSignal<T, U = undefined>( | |||
throw current.error; | |||
case StateKind.NoValue: | |||
// This shouldn't really happen because the error is thrown on creation. | |||
// TODO(alxhub): use a RuntimeError when we finalize the error semantics | |||
throw new ɵRuntimeError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sounds like a repeated code - would it make sense to pull it out into a utility function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only repeated code is half of the if
statement (kind === StateKind.NoValue)and the
throw new RuntimeError` so I'm not sure it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, but I'm not thrilled about having the error message in 2 places.
This PR was merged into the repository by commit fe41b11. The changes were merged into the following branches: main, 18.1.x |
Adds an `ngDevMode` check before a runtime error message. Fixes angular#57034. PR Close angular#57035
Adds an `ngDevMode` check before a runtime error message. Fixes angular#57034. PR Close angular#57035
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds an
ngDevMode
check before a runtime error message.