File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,12 +35,6 @@ export class Term {
3535 return this . id ;
3636 }
3737
38- // ### Implement hashCode for Immutable.js, since we implement `equals`
39- // https://immutable-js.com/docs/v4.0.0/ValueObject/#hashCode()
40- get hashCode ( ) {
41- return 0 ;
42- }
43-
4438 // ### Returns whether this object represents the same term as the other
4539 equals ( other ) {
4640 // If both terms were created by this library,
@@ -52,6 +46,12 @@ export class Term {
5246 this . value === other . value ;
5347 }
5448
49+ // ### Implement hashCode for Immutable.js, since we implement `equals`
50+ // https://immutable-js.com/docs/v4.0.0/ValueObject/#hashCode()
51+ hashCode ( ) {
52+ return 0 ;
53+ }
54+
5555 // ### Returns a plain object representation of this term
5656 toJSON ( ) {
5757 return {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ describe('Term', () => {
2828
2929 describe ( 'A Term instance' , ( ) => {
3030 it ( 'has an integer hashCode' , ( ) => {
31- new Term ( ) . should . have . property ( 'hashCode' , 0 ) ;
31+ new Term ( ) . hashCode ( ) . should . equal ( 0 ) ;
3232 } ) ;
3333 } ) ;
3434
You can’t perform that action at this time.
0 commit comments