@@ -109,10 +109,7 @@ class MyDate extends Date {
109109
110110const date2 = new MyDate ( '2016' ) ;
111111
112- // deepEqual returns true as long as the time are the same,
113- // but deepStrictEqual checks own properties
114- assert . notDeepEqual ( date , date2 ) ;
115- assert . notDeepEqual ( date2 , date ) ;
112+ assertNotDeepOrStrict ( date , date2 ) ;
116113assert . throws (
117114 ( ) => assert . deepStrictEqual ( date , date2 ) ,
118115 {
@@ -142,9 +139,7 @@ class MyRegExp extends RegExp {
142139const re1 = new RegExp ( 'test' ) ;
143140const re2 = new MyRegExp ( 'test' ) ;
144141
145- // deepEqual returns true as long as the regexp-specific properties
146- // are the same, but deepStrictEqual checks all properties
147- assert . notDeepEqual ( re1 , re2 ) ;
142+ assertNotDeepOrStrict ( re1 , re2 ) ;
148143assert . throws (
149144 ( ) => assert . deepStrictEqual ( re1 , re2 ) ,
150145 {
@@ -684,7 +679,7 @@ assert.throws(
684679 }
685680) ;
686681
687- assert . deepEqual ( new Date ( 2000 , 3 , 14 ) , new Date ( 2000 , 3 , 14 ) ) ;
682+ assertDeepAndStrictEqual ( new Date ( 2000 , 3 , 14 ) , new Date ( 2000 , 3 , 14 ) ) ;
688683
689684assert . throws ( ( ) => { assert . deepEqual ( new Date ( ) , new Date ( 2000 , 3 , 14 ) ) ; } ,
690685 AssertionError ,
@@ -702,7 +697,7 @@ assert.throws(
702697 'notDeepEqual("a".repeat(1024), "a".repeat(1024))'
703698) ;
704699
705- assert . notDeepEqual ( new Date ( ) , new Date ( 2000 , 3 , 14 ) ) ;
700+ assertNotDeepOrStrict ( new Date ( ) , new Date ( 2000 , 3 , 14 ) ) ;
706701
707702assertDeepAndStrictEqual ( / a / , / a / ) ;
708703assertDeepAndStrictEqual ( / a / g, / a / g) ;
@@ -743,7 +738,7 @@ a2.b = true;
743738a2 . a = 'test' ;
744739assert . throws ( ( ) => assert . deepEqual ( Object . keys ( a1 ) , Object . keys ( a2 ) ) ,
745740 AssertionError ) ;
746- assert . deepEqual ( a1 , a2 ) ;
741+ assertDeepAndStrictEqual ( a1 , a2 ) ;
747742
748743// Having an identical prototype property.
749744const nbRoot = {
@@ -899,14 +894,12 @@ assert.throws(
899894
900895/* eslint-enable */
901896
902- assert . deepStrictEqual ( { a : 4 , b : '1' } , { b : '1' , a : 4 } ) ;
897+ assertDeepAndStrictEqual ( { a : 4 , b : '1' } , { b : '1' , a : 4 } ) ;
903898
904899assert . throws (
905900 ( ) => assert . deepStrictEqual ( [ 0 , 1 , 2 , 'a' , 'b' ] , [ 0 , 1 , 2 , 'b' , 'a' ] ) ,
906901 AssertionError ) ;
907902
908- assert . deepStrictEqual ( a1 , a2 ) ;
909-
910903// Prototype check.
911904function Constructor1 ( first , last ) {
912905 this . first = first ;
@@ -926,7 +919,7 @@ assert.throws(() => assert.deepStrictEqual(obj1, obj2), AssertionError);
926919Constructor2 . prototype = Constructor1 . prototype ;
927920obj2 = new Constructor2 ( 'Ryan' , 'Dahl' ) ;
928921
929- assert . deepStrictEqual ( obj1 , obj2 ) ;
922+ assertDeepAndStrictEqual ( obj1 , obj2 ) ;
930923
931924// Check extra properties on errors.
932925{
@@ -1047,7 +1040,7 @@ assert.throws(
10471040 Object . defineProperty ( a , 'getTime' , {
10481041 value : ( ) => 5
10491042 } ) ;
1050- assert . deepStrictEqual ( a , b ) ;
1043+ assertDeepAndStrictEqual ( a , b ) ;
10511044}
10521045
10531046// Verify that extra keys will be tested for when using fake arrays.
@@ -1064,7 +1057,7 @@ assert.throws(
10641057 Object . defineProperty ( a , 'length' , {
10651058 value : 2
10661059 } ) ;
1067- assert . notDeepStrictEqual ( a , [ 1 , 1 ] ) ;
1060+ assertNotDeepOrStrict ( a , [ 1 , 1 ] ) ;
10681061}
10691062
10701063// Verify that changed tags will still check for the error message.
0 commit comments