You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
No errors, and this: AssertionError, and assert.AssertionError is a constructor function.
Actual behavior: this: typeof assert, which is a function, so that, for example this.name tries to overwrite the built-in Function.name. Basically, assert.AssertionError behaves like a static method of assert instead of a static property that is a constructor function.
Note that usage of assert.AssertionError works as desired: you can say new assert.AssertionError().actual.
The text was updated successfully, but these errors were encountered:
This works correctly if you put @constructor in front of assert.AssertionError. Since the usages are ambiguous, I think this it's OK to require an annotation. You could argue that the annotation be required in the opposite case because it's (possibly) less common, but JSDoc doesn't already have a tag for marking things as static methods, as far as I know.
Expected behavior:
No errors, and
this: AssertionError
, and assert.AssertionError is a constructor function.Actual behavior:
this: typeof assert
, which is a function, so that, for examplethis.name
tries to overwrite the built-in Function.name. Basically,assert.AssertionError
behaves like a static method ofassert
instead of a static property that is a constructor function.Note that usage of
assert.AssertionError
works as desired: you can saynew assert.AssertionError().actual
.The text was updated successfully, but these errors were encountered: