Skip to content

Commit 512d477

Browse files
committed
Add minor improvements for type-of function
1 parent 0ae11a4 commit 512d477

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/ast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ namespace Sass {
13351335
public:
13361336
String_Schema(ParserState pstate, size_t size = 0, bool has_interpolants = false)
13371337
: String(pstate), Vectorized<Expression*>(size), has_interpolants_(has_interpolants), hash_(0)
1338-
{ }
1338+
{ concrete_type(STRING); }
13391339
std::string type() { return "string"; }
13401340
static std::string type_name() { return "string"; }
13411341

src/functions.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,11 +1447,7 @@ namespace Sass {
14471447
BUILT_IN(type_of)
14481448
{
14491449
Expression* v = ARG("$value", Expression);
1450-
if (v->concrete_type() == Expression::STRING) {
1451-
To_String to_string(&ctx);
1452-
std::string str(v->perform(&to_string));
1453-
}
1454-
return new (ctx.mem) String_Quoted(pstate, ARG("$value", Expression)->type());
1450+
return new (ctx.mem) String_Quoted(pstate, v->type());
14551451
}
14561452

14571453
Signature unit_sig = "unit($number)";

0 commit comments

Comments
 (0)