mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-30 04:39:03 +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")
|
@JS("Object.create")
|
||||||
external Object _create(Object prototype);
|
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.
|
/// Injects [constructor] into the inheritance chain for [object]'s class.
|
||||||
void injectSuperclass(Object object, Function constructor) {
|
void injectSuperclass(Object object, Function constructor) {
|
||||||
var prototype = _getPrototypeOf(object);
|
var prototype = _getPrototypeOf(object);
|
||||||
|
@ -21,6 +21,7 @@ final Function booleanConstructor = () {
|
|||||||
"Use sass.types.Boolean.TRUE or sass.types.Boolean.FALSE instead.";
|
"Use sass.types.Boolean.TRUE or sass.types.Boolean.FALSE instead.";
|
||||||
});
|
});
|
||||||
injectSuperclass(sassTrue, constructor);
|
injectSuperclass(sassTrue, constructor);
|
||||||
|
setClassName(sassTrue, "SassBoolean");
|
||||||
forwardToString(constructor);
|
forwardToString(constructor);
|
||||||
setProperty(
|
setProperty(
|
||||||
getProperty(constructor, "prototype"),
|
getProperty(constructor, "prototype"),
|
||||||
|
@ -21,6 +21,7 @@ final Function nullConstructor = () {
|
|||||||
"instead.";
|
"instead.";
|
||||||
});
|
});
|
||||||
injectSuperclass(sassNull, constructor);
|
injectSuperclass(sassNull, constructor);
|
||||||
|
setClassName(sassNull, "SassNull");
|
||||||
forwardToString(constructor);
|
forwardToString(constructor);
|
||||||
setProperty(constructor, "NULL", sassNull);
|
setProperty(constructor, "NULL", sassNull);
|
||||||
setToString(sassNull, () => "null");
|
setToString(sassNull, () => "null");
|
||||||
|
Loading…
Reference in New Issue
Block a user