Skip to content

Commit 0ffdbd8

Browse files
authored
Fix node sass lagging (#50)
1 parent 0db911d commit 0ffdbd8

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/libsass/src/ast.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ namespace Sass {
385385

386386
bool Selector_Schema::operator== (const Selector& rhs) const
387387
{
388-
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return *this == static_cast<const Selector_List&>(*sl);
389-
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return *this == static_cast<const Simple_Selector&>(*sp);
390-
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return *this == static_cast<const Complex_Selector&>(*cs);
391-
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return *this == static_cast<const Compound_Selector&>(*ch);
388+
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return *this == *sl;
389+
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return *this == *sp;
390+
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return *this == *cs;
391+
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return *this == *ch;
392392
throw std::runtime_error("invalid selector base classes to compare");
393393
}
394394

@@ -403,7 +403,7 @@ namespace Sass {
403403

404404
bool Simple_Selector::operator== (const Selector& rhs) const
405405
{
406-
if (Simple_Selector_Ptr_Const sp = Cast<Simple_Selector>(&rhs)) return *this == static_cast<const Simple_Selector&>(*sp);
406+
if (Simple_Selector_Ptr_Const sp = Cast<Simple_Selector>(&rhs)) return *this == *sp;
407407
return false;
408408
}
409409

@@ -760,7 +760,7 @@ namespace Sass {
760760
{
761761
if (Pseudo_Selector_Ptr_Const w = Cast<Pseudo_Selector>(&rhs))
762762
{
763-
return *this == static_cast<const Pseudo_Selector&>(*w);
763+
return *this == *w;
764764
}
765765
return is_ns_eq(rhs) &&
766766
name() == rhs.name();
@@ -802,7 +802,7 @@ namespace Sass {
802802
{
803803
if (Wrapped_Selector_Ptr_Const w = Cast<Wrapped_Selector>(&rhs))
804804
{
805-
return *this == static_cast<const Wrapped_Selector&>(*w);
805+
return *this == *w;
806806
}
807807
return is_ns_eq(rhs) &&
808808
name() == rhs.name();
@@ -1877,7 +1877,7 @@ namespace Sass {
18771877
bool Number::operator== (const Expression& rhs) const
18781878
{
18791879
if (auto rhsnr = Cast<Number>(&rhs)) {
1880-
return *this == static_cast<const Number&>(*rhsnr);
1880+
return *this == *rhsnr;
18811881
}
18821882
return false;
18831883
}

src/libsass/src/ast_fwd_decl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ namespace Sass {
382382
if (dynamic_cast<Number*>(lhs.ptr()))
383383
if (dynamic_cast<Number*>(rhs.ptr()))
384384
return lhs->hash() == rhs->hash();
385-
return !lhs.isNull() && !rhs.isNull() && lhs->eq(*rhs);
385+
return !lhs.isNull() && !rhs.isNull() && *lhs == *rhs;
386386
}
387387
};
388388

src/libsass/src/operators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Sass {
3232
// operation is undefined if one is not a number
3333
if (!lhs || !rhs) throw Exception::UndefinedOperation(lhs, rhs, Sass_OP::EQ);
3434
// use compare operator from ast node
35-
return lhs->eq(*rhs);
35+
return *lhs == *rhs;
3636
}
3737

3838
/* static function, throws OperationError, has no pstate or traces */

0 commit comments

Comments
 (0)