restore Chrome 49 compatibility: remove "u" flag in RegExp
since it wasn't used globally (e.g. vendor code) it made no real difference
This commit is contained in:
parent
6b0628a7ee
commit
0ba26072f7
|
@ -176,8 +176,8 @@
|
||||||
|
|
||||||
const execAt = (rx, i) => (rx.lastIndex = i) && null || rx.exec(text);
|
const execAt = (rx, i) => (rx.lastIndex = i) && null || rx.exec(text);
|
||||||
const at = (rx, i) => (rx.lastIndex = i) && null || rx.test(text);
|
const at = (rx, i) => (rx.lastIndex = i) && null || rx.test(text);
|
||||||
const atWord = ch => at(/\w/uy, ch);
|
const atWord = ch => at(/\w/y, ch);
|
||||||
const atSpace = ch => at(/\s/uy, ch);
|
const atSpace = ch => at(/\s/y, ch);
|
||||||
|
|
||||||
const atTokenEnd = styles.indexOf(ch, 1);
|
const atTokenEnd = styles.indexOf(ch, 1);
|
||||||
ch += atTokenEnd < 0 ? 0 : sticky === 'before' && atWord(ch - 1) ? 0 : atSpace(ch + 1) ? 0 : 1;
|
ch += atTokenEnd < 0 ? 0 : sticky === 'before' && atWord(ch - 1) ? 0 : atSpace(ch + 1) ? 0 : 1;
|
||||||
|
@ -189,19 +189,19 @@
|
||||||
const isNumber = type === 'number';
|
const isNumber = type === 'number';
|
||||||
const isSpace = atSpace(ch);
|
const isSpace = atSpace(ch);
|
||||||
let wordChars =
|
let wordChars =
|
||||||
isNumber ? /[-+\w.%]/uy :
|
isNumber ? /[-+\w.%]/y :
|
||||||
isCss ? /[-\w@]/uy :
|
isCss ? /[-\w@]/y :
|
||||||
isSpace ? /\s/uy :
|
isSpace ? /\s/y :
|
||||||
atWord(ch) ? /\w/uy : /[^\w\s]/uy;
|
atWord(ch) ? /\w/y : /[^\w\s]/y;
|
||||||
|
|
||||||
let a = ch;
|
let a = ch;
|
||||||
while (a && at(wordChars, a)) a--;
|
while (a && at(wordChars, a)) a--;
|
||||||
a += !a && at(wordChars, a) || isCss && at(/[.!#@]/uy, a) ? 0 : at(wordChars, a + 1);
|
a += !a && at(wordChars, a) || isCss && at(/[.!#@]/y, a) ? 0 : at(wordChars, a + 1);
|
||||||
|
|
||||||
let b, found;
|
let b, found;
|
||||||
|
|
||||||
if (isNumber) {
|
if (isNumber) {
|
||||||
b = a + execAt(/[+-]?[\d.]+(e\d+)?|$/uyi, a)[0].length;
|
b = a + execAt(/[+-]?[\d.]+(e\d+)?|$/yi, a)[0].length;
|
||||||
found = b >= ch;
|
found = b >= ch;
|
||||||
if (!found) {
|
if (!found) {
|
||||||
a = b;
|
a = b;
|
||||||
|
@ -210,7 +210,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
wordChars = isCss ? /[-\w]*/uy : new RegExp(wordChars.source + '*', 'uy');
|
wordChars = isCss ? /[-\w]*/y : new RegExp(wordChars.source + '*', 'uy');
|
||||||
b = ch + execAt(wordChars, ch)[0].length;
|
b = ch + execAt(wordChars, ch)[0].length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ CodeMirror.hint && (() => {
|
||||||
const USO_VAR = 'uso-variable';
|
const USO_VAR = 'uso-variable';
|
||||||
const USO_VALID_VAR = 'variable-3 ' + USO_VAR;
|
const USO_VALID_VAR = 'variable-3 ' + USO_VAR;
|
||||||
const USO_INVALID_VAR = 'error ' + USO_VAR;
|
const USO_INVALID_VAR = 'error ' + USO_VAR;
|
||||||
const RX_IMPORTANT = /(i(m(p(o(r(t(a(nt?)?)?)?)?)?)?)?)?(?=\b|\W|$)/iyu;
|
const RX_IMPORTANT = /(i(m(p(o(r(t(a(nt?)?)?)?)?)?)?)?)?(?=\b|\W|$)/iy;
|
||||||
|
|
||||||
const originalHelper = CodeMirror.hint.css || (() => {});
|
const originalHelper = CodeMirror.hint.css || (() => {});
|
||||||
CodeMirror.registerHelper('hint', 'css', function (cm) {
|
CodeMirror.registerHelper('hint', 'css', function (cm) {
|
||||||
|
@ -238,7 +238,7 @@ CodeMirror.hint && (() => {
|
||||||
if (style && (style.startsWith('comment') || style.startsWith('string'))) {
|
if (style && (style.startsWith('comment') || style.startsWith('string'))) {
|
||||||
return originalHelper(cm);
|
return originalHelper(cm);
|
||||||
}
|
}
|
||||||
if (text[ch - 1] === '!' && /i|\W|^$/iu.test(text[ch] || '')) {
|
if (text[ch - 1] === '!' && /i|\W|^$/i.test(text[ch] || '')) {
|
||||||
RX_IMPORTANT.lastIndex = ch;
|
RX_IMPORTANT.lastIndex = ch;
|
||||||
return {
|
return {
|
||||||
list: ['important'],
|
list: ['important'],
|
||||||
|
|
|
@ -34,7 +34,7 @@ function parseMozFormat({code, styleId}) {
|
||||||
// move last comment before @-moz-document inside the section
|
// move last comment before @-moz-document inside the section
|
||||||
if (!lastCmt.includes('AGENT_SHEET') &&
|
if (!lastCmt.includes('AGENT_SHEET') &&
|
||||||
!lastCmt.includes('==') &&
|
!lastCmt.includes('==') &&
|
||||||
!/==userstyle==/iu.test(lastCmt)) {
|
!/==userstyle==/i.test(lastCmt)) {
|
||||||
if (lastCmt) {
|
if (lastCmt) {
|
||||||
section.code = lastCmt + '\n';
|
section.code = lastCmt + '\n';
|
||||||
outerText = outerText.slice(0, -lastCmt.length);
|
outerText = outerText.slice(0, -lastCmt.length);
|
||||||
|
|
|
@ -112,7 +112,7 @@ class Reporter {
|
||||||
//eslint-disable-next-line no-var
|
//eslint-disable-next-line no-var
|
||||||
var CSSLint = (() => {
|
var CSSLint = (() => {
|
||||||
|
|
||||||
const RX_EMBEDDED = /\/\*\s*csslint\s+((?:[^*]|\*(?!\/))+?)\*\//igu;
|
const RX_EMBEDDED = /\/\*\s*csslint\s+((?:[^*]|\*(?!\/))+?)\*\//ig;
|
||||||
const EBMEDDED_RULE_VALUE_MAP = {
|
const EBMEDDED_RULE_VALUE_MAP = {
|
||||||
// error
|
// error
|
||||||
'true': 2,
|
'true': 2,
|
||||||
|
|
|
@ -3354,15 +3354,15 @@ self.parserlib = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
readUnquotedURL(first) {
|
readUnquotedURL(first) {
|
||||||
return this.readChunksWithEscape(first, /[-!#$%&*-[\]-~\u00A0-\uFFFF]+/yu);
|
return this.readChunksWithEscape(first, /[-!#$%&*-[\]-~\u00A0-\uFFFF]+/y);
|
||||||
}
|
}
|
||||||
|
|
||||||
readName(first) {
|
readName(first) {
|
||||||
return this.readChunksWithEscape(first, /[-_\da-zA-Z\u00A0-\uFFFF]+/yu);
|
return this.readChunksWithEscape(first, /[-_\da-zA-Z\u00A0-\uFFFF]+/y);
|
||||||
}
|
}
|
||||||
|
|
||||||
readEscape() {
|
readEscape() {
|
||||||
const cp = this._reader.readMatch(/[0-9a-f]{1,6}\b\s*/iyu);
|
const cp = this._reader.readMatch(/[0-9a-f]{1,6}\b\s*/iy);
|
||||||
return cp ? String.fromCodePoint(parseInt(cp, 16)) : this._reader.read();
|
return cp ? String.fromCodePoint(parseInt(cp, 16)) : this._reader.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3388,7 +3388,7 @@ self.parserlib = (() => {
|
||||||
readComment(first) {
|
readComment(first) {
|
||||||
return first +
|
return first +
|
||||||
this._reader.readCount(2 - first.length) +
|
this._reader.readCount(2 - first.length) +
|
||||||
this._reader.readMatch(/([^*]|\*(?!\/))*(\*\/|$)/yu);
|
this._reader.readMatch(/([^*]|\*(?!\/))*(\*\/|$)/y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user