Bug 1436790 - Update Fluent in Gecko to 0.6.2. r=Pike

MozReview-Commit-ID: BC2oTIGLips

--HG--
extra : rebase_source : b7d5122123ff49a2332d3848e235c0c6ae1c0921
This commit is contained in:
Zibi Braniecki 2018-02-08 10:59:29 -08:00
parent a167feb192
commit 5fe1b2b553

View File

@ -95,7 +95,8 @@ class RuntimeParser {
// We don't care about comments or sections at runtime
if (ch === '/' ||
(ch === '#' && [' ', '#'].includes(this._source[this._index + 1]))) {
(ch === '#' &&
[' ', '#', '\n'].includes(this._source[this._index + 1]))) {
this.skipComment();
return;
}
@ -360,7 +361,9 @@ class RuntimeParser {
this.skipBlankLines();
if (this._source[this._index] !== ' ') {
// No indentation means we're done with this message.
// No indentation means we're done with this message. Callers should check
// if the return value here is null. It may be OK for messages, but not OK
// for terms, attributes and variants.
return firstLineContent;
}
@ -779,6 +782,10 @@ class RuntimeParser {
const val = this.getPattern();
if (val === null) {
throw this.error('Expected attribute to have a value');
}
if (typeof val === 'string') {
attrs[key] = val;
} else {
@ -826,11 +833,13 @@ class RuntimeParser {
this.skipInlineWS();
const variant = {
key,
val: this.getPattern()
};
variants[index++] = variant;
const val = this.getPattern();
if (val === null) {
throw this.error('Expected variant to have a value');
}
variants[index++] = {key, val};
this.skipWS();
}