-
Notifications
You must be signed in to change notification settings - Fork 472
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 a test using console.log
instead of print
#4110
base: main
Are you sure you want to change the base?
Conversation
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.
This test probably shouldn't be using print()
either — nothing will be listening to the output of print()
unless the test has the async
flag, and I believe it would be legal for implementations' test runners to fail the test on unexpected calls to print()
.
If I understand correctly what this is supposed to test, I'd say let's just use () => {}
.
@@ -49,7 +49,7 @@ assert.compareArray(valuesNormal, [44, 43, 42]); | |||
function TestDisposableStackDeferOnDisposedStack() { | |||
let stack = new DisposableStack(); | |||
stack.dispose(); | |||
stack.defer(() => console.log(42)); | |||
stack.defer(() => print(42)); |
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.
stack.defer(() => print(42)); | |
stack.defer(() => { throw new Error("Code should not reach here"); }); | |
throw new Error("Code should not reach here"); |
It's been a while I use Test262, but I believe this might resolve the issue better and confirm no run runs post .defer as well.
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.
Given
3. If disposableStack.[[DisposableState]] is disposed, throw a ReferenceError exception.
4. If IsCallable(onDispose) is false, throw a TypeError exception.
Line 52 can also use a simple stack.defer('');
so it can observe the ReferenceError in the correct order.
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.
Sure, that would work as well.
No description provided.