assertNoUnits method Null safety

void assertNoUnits(
  1. [String? name]
)

Throws a SassScriptException unless this has no units.

If this came from a function argument, name is the argument name (without the $). It's used for error reporting.

Implementation

void assertNoUnits([String? name]) {
  if (!hasUnits) return;
  throw _exception('Expected $this to have no units.', name);
}