@@ -188,13 +188,13 @@ TEST_CLASS (JSValueTest) {
188
188
TEST_METHOD (TestObjectLiteral) {
189
189
JSValue jsValue = JSValueObject{
190
190
{" NullValue1" , nullptr },
191
- {" NullValue2" , JSValue::Null .Copy ()},
191
+ {" NullValue2" , JSValue::NullRef () .Copy ()},
192
192
{" ObjValue" , JSValueObject{{" prop1" , 2 }}},
193
- {" ObjValueEmpty" , JSValue::EmptyObject .Copy ()},
193
+ {" ObjValueEmpty" , JSValue::EmptyObjectRef () .Copy ()},
194
194
{" ArrayValue" , JSValueArray{1 , 2 }},
195
- {" ArrayValueEmpty" , JSValue::EmptyArray .Copy ()},
195
+ {" ArrayValueEmpty" , JSValue::EmptyArrayRef () .Copy ()},
196
196
{" StringValue1" , " Hello" },
197
- {" StringValue2" , JSValue::EmptyString .Copy ()},
197
+ {" StringValue2" , JSValue::EmptyStringRef () .Copy ()},
198
198
{" BoolValue" , true },
199
199
{" IntValue" , 42 },
200
200
{" DoubleValue" , 4.5 }};
@@ -493,9 +493,9 @@ TEST_CLASS (JSValueTest) {
493
493
auto AsObjectIsEmpty = [](JSValue const &value) { return value.AsObject ().empty (); };
494
494
495
495
TestCheck (!AsObjectIsEmpty (JSValueObject{{" prop1" , 42 }}));
496
- TestCheck (AsObjectIsEmpty (JSValue::EmptyObject ));
496
+ TestCheck (AsObjectIsEmpty (JSValue::EmptyObjectRef () ));
497
497
TestCheck (AsObjectIsEmpty (JSValueArray{42 , 78 }));
498
- TestCheck (AsObjectIsEmpty (JSValue::EmptyArray ));
498
+ TestCheck (AsObjectIsEmpty (JSValue::EmptyArrayRef () ));
499
499
TestCheck (AsObjectIsEmpty (" " ));
500
500
TestCheck (AsObjectIsEmpty (" Hello" ));
501
501
TestCheck (AsObjectIsEmpty (true ));
@@ -509,17 +509,17 @@ TEST_CLASS (JSValueTest) {
509
509
TestCheck (AsObjectIsEmpty (std::numeric_limits<double >::quiet_NaN ()));
510
510
TestCheck (AsObjectIsEmpty (std::numeric_limits<double >::infinity ()));
511
511
TestCheck (AsObjectIsEmpty (-std::numeric_limits<double >::infinity ()));
512
- TestCheck (AsObjectIsEmpty (JSValue::Null ));
512
+ TestCheck (AsObjectIsEmpty (JSValue::NullRef () ));
513
513
}
514
514
515
515
TEST_METHOD (TestAsArray) {
516
516
// Any type except for Array is returned as EmptyArray.
517
517
auto AsArrayIsEmpty = [](JSValue const &value) { return value.AsArray ().empty (); };
518
518
519
519
TestCheck (AsArrayIsEmpty (JSValueObject{{" prop1" , 42 }}));
520
- TestCheck (AsArrayIsEmpty (JSValue::EmptyObject ));
520
+ TestCheck (AsArrayIsEmpty (JSValue::EmptyObjectRef () ));
521
521
TestCheck (!AsArrayIsEmpty (JSValueArray{42 , 78 }));
522
- TestCheck (AsArrayIsEmpty (JSValue::EmptyArray ));
522
+ TestCheck (AsArrayIsEmpty (JSValue::EmptyArrayRef () ));
523
523
TestCheck (AsArrayIsEmpty (" " ));
524
524
TestCheck (AsArrayIsEmpty (" Hello" ));
525
525
TestCheck (AsArrayIsEmpty (true ));
@@ -533,7 +533,7 @@ TEST_CLASS (JSValueTest) {
533
533
TestCheck (AsArrayIsEmpty (std::numeric_limits<double >::quiet_NaN ()));
534
534
TestCheck (AsArrayIsEmpty (std::numeric_limits<double >::infinity ()));
535
535
TestCheck (AsArrayIsEmpty (-std::numeric_limits<double >::infinity ()));
536
- TestCheck (AsArrayIsEmpty (JSValue::Null ));
536
+ TestCheck (AsArrayIsEmpty (JSValue::NullRef () ));
537
537
}
538
538
539
539
// Check AsString, AsBoolean, AsInt64, and AsDouble conversions.
@@ -570,9 +570,9 @@ TEST_CLASS (JSValueTest) {
570
570
571
571
TEST_METHOD (TestAsConverters) {
572
572
CheckAsConverter ((JSValueObject{{" prop1" , 42 }}), " " , true , 0 , 0 );
573
- CheckAsConverter (JSValue::EmptyObject , " " , false , 0 , 0 );
573
+ CheckAsConverter (JSValue::EmptyObjectRef () , " " , false , 0 , 0 );
574
574
CheckAsConverter ((JSValueArray{42 , 78 }), " " , true , 0 , 0 );
575
- CheckAsConverter (JSValue::EmptyArray , " " , false , 0 , 0 );
575
+ CheckAsConverter (JSValue::EmptyArrayRef () , " " , false , 0 , 0 );
576
576
CheckAsConverter (" " , " " , false , 0 , 0 );
577
577
CheckAsConverter (" " , " " , false , 0 , 0 );
578
578
CheckAsConverter (" 42" , " 42" , false , 42 , 42 );
@@ -624,7 +624,7 @@ TEST_CLASS (JSValueTest) {
624
624
CheckAsConverter (NAN, " NaN" , false , 0 , NAN);
625
625
CheckAsConverter (INFINITY, " Infinity" , true , 0 , INFINITY);
626
626
CheckAsConverter (-INFINITY, " -Infinity" , true , 0 , -INFINITY);
627
- CheckAsConverter (JSValue::Null , " null" , false , 0 , 0 );
627
+ CheckAsConverter (JSValue::NullRef () , " null" , false , 0 , 0 );
628
628
}
629
629
630
630
TEST_METHOD (TestExplicitNumberConversion) {
0 commit comments