MCPcopy
hub / github.com/less/less.js / expect

Function expect

packages/less/lib/less/parser/parser.js:89–99  ·  view source on GitHub ↗
(arg, msg)

Source from the content-addressed store, hash-verified

87 }
88
89 function expect(arg, msg) {
90 // some older browsers return typeof 'function' for RegExp
91 const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);
92 if (result) {
93 return result;
94 }
95
96 error(msg || (typeof arg === 'string'
97 ? `expected '${arg}' got '${parserInput.currentChar()}'`
98 : 'unexpected token'));
99 }
100
101 // Specialization of expect()
102 function expectChar(arg, msg) {

Callers 7

conditionFunction · 0.85
ParserFunction · 0.85
common.jsFile · 0.85

Calls 2

callMethod · 0.80
errorFunction · 0.70

Tested by

no test coverage detected