mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-26 20:24:42 +01:00
Explicitly set the JS class names for SassNull and SassBoolean (#941)
For whatever reason the default name seems to have changed.
This commit is contained in:
parent
5450c1c07b
commit
6234489eaa
@ -94,6 +94,12 @@ class _PropertyDescriptor {
|
||||
@JS("Object.create")
|
||||
external Object _create(Object prototype);
|
||||
|
||||
/// Sets the name of `object`'s class to `name`.
|
||||
void setClassName(Object object, String name) {
|
||||
_defineProperty(getProperty(object, "constructor"), "name",
|
||||
_PropertyDescriptor(value: name));
|
||||
}
|
||||
|
||||
/// Injects [constructor] into the inheritance chain for [object]'s class.
|
||||
void injectSuperclass(Object object, Function constructor) {
|
||||
var prototype = _getPrototypeOf(object);
|
||||
|
@ -21,6 +21,7 @@ final Function booleanConstructor = () {
|
||||
"Use sass.types.Boolean.TRUE or sass.types.Boolean.FALSE instead.";
|
||||
});
|
||||
injectSuperclass(sassTrue, constructor);
|
||||
setClassName(sassTrue, "SassBoolean");
|
||||
forwardToString(constructor);
|
||||
setProperty(
|
||||
getProperty(constructor, "prototype"),
|
||||
|
@ -21,6 +21,7 @@ final Function nullConstructor = () {
|
||||
"instead.";
|
||||
});
|
||||
injectSuperclass(sassNull, constructor);
|
||||
setClassName(sassNull, "SassNull");
|
||||
forwardToString(constructor);
|
||||
setProperty(constructor, "NULL", sassNull);
|
||||
setToString(sassNull, () => "null");
|
||||
|
Loading…
Reference in New Issue
Block a user