MCPcopy Index your code
hub / github.com/nodejs/node / assertLanguageTag

Function assertLanguageTag

deps/v8/test/intl/assert.js:284–294  ·  view source on GitHub ↗

* Throw if |parent| is not a more general language tag of |child|, nor |child| * itself, per BCP 47 rules.

(child, parent)

Source from the content-addressed store, hash-verified

282 * itself, per BCP 47 rules.
283 */
284function assertLanguageTag(child, parent) {
285 var childSplit = splitLanguageTag(child);
286 var parentSplit = splitLanguageTag(parent);
287
288 // Do not compare extensions at this moment, as %GetDefaultICULocale()
289 // doesn't always output something we support.
290 if (childSplit.locale !== parentSplit.locale &&
291 !childSplit.locale.startsWith(parentSplit.locale + '-')) {
292 fail(child, parent, 'language tag comparison');
293 }
294}
295
296function assertArrayEquals(expected, found, name_opt) {
297 var start = "";

Callers 1

options.jsFile · 0.85

Calls 2

splitLanguageTagFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…