Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Fix YUI Compressor incompatibilities and improve JavaScript correctness #2452

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ var webpackModule = {
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015']
presets: ['es2015'],
plugins: ['transform-es3-property-literals', 'transform-es3-member-expression-literals']
}
}
],
Expand Down
48 changes: 24 additions & 24 deletions lib/network/modules/components/shared/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,63 +519,63 @@ class Label {
}
}
while (s.position < text.length) {
let char = text.charAt(s.position);
if (/[ \t]/.test(char)) {
let ch = text.charAt(s.position);
if (/[ \t]/.test(ch)) {
if (!s.mono) {
s.spacing = true;
} else {
s.add(char);
s.add(ch);
}
s.beginable = true
} else if (/\\/.test(char)) {
} else if (/\\/.test(ch)) {
if (s.position < text.length+1) {
s.position++;
char = text.charAt(s.position);
if (/ \t/.test(char)) {
ch = text.charAt(s.position);
if (/ \t/.test(ch)) {
s.spacing = true;
} else {
s.add(char);
s.add(ch);
s.beginable = false;
}
}
} else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\*/.test(char)) {
} else if (!s.mono && !s.bold && (s.beginable || s.spacing) && /\*/.test(ch)) {
s.emitBlock();
s.bold = true;
s.modStack.unshift("bold");
} else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\_/.test(char)) {
} else if (!s.mono && !s.ital && (s.beginable || s.spacing) && /\_/.test(ch)) {
s.emitBlock();
s.ital = true;
s.modStack.unshift("ital");
} else if (!s.mono && (s.beginable || s.spacing) && /`/.test(char)) {
} else if (!s.mono && (s.beginable || s.spacing) && /`/.test(ch)) {
s.emitBlock();
s.mono = true;
s.modStack.unshift("mono");
} else if (!s.mono && (s.mod() === "bold") && /\*/.test(char)) {
} else if (!s.mono && (s.mod() === "bold") && /\*/.test(ch)) {
if ((s.position === text.length-1) || /[.,_` \t\n]/.test(text.charAt(s.position+1))) {
s.emitBlock();
s.bold = false;
s.modStack.shift();
} else {
s.add(char);
s.add(ch);
}
} else if (!s.mono && (s.mod() === "ital") && /\_/.test(char)) {
} else if (!s.mono && (s.mod() === "ital") && /\_/.test(ch)) {
if ((s.position === text.length-1) || /[.,*` \t\n]/.test(text.charAt(s.position+1))) {
s.emitBlock();
s.ital = false;
s.modStack.shift();
} else {
s.add(char);
s.add(ch);
}
} else if (s.mono && (s.mod() === "mono") && /`/.test(char)) {
} else if (s.mono && (s.mod() === "mono") && /`/.test(ch)) {
if ((s.position === text.length-1) || (/[.,*_ \t\n]/.test(text.charAt(s.position+1)))) {
s.emitBlock();
s.mono = false;
s.modStack.shift();
} else {
s.add(char);
s.add(ch);
}
} else {
s.add(char);
s.add(ch);
s.beginable = false;
}
s.position++
Expand Down Expand Up @@ -636,14 +636,14 @@ class Label {
}
}
while (s.position < text.length) {
let char = text.charAt(s.position);
if (/[ \t]/.test(char)) {
let ch = text.charAt(s.position);
if (/[ \t]/.test(ch)) {
if (!s.mono) {
s.spacing = true;
} else {
s.add(char);
s.add(ch);
}
} else if (/</.test(char)) {
} else if (/</.test(ch)) {
if (!s.mono && !s.bold && /<b>/.test(text.substr(s.position,3))) {
s.emitBlock();
s.bold = true;
Expand Down Expand Up @@ -675,9 +675,9 @@ class Label {
s.modStack.shift();
s.position += 6;
} else {
s.add(char);
s.add(ch);
}
} else if (/&/.test(char)) {
} else if (/&/.test(ch)) {
if (/&lt;/.test(text.substr(s.position,4))) {
s.add("<");
s.position += 3;
Expand All @@ -688,7 +688,7 @@ class Label {
s.add("&");
}
} else {
s.add(char);
s.add(ch);
}
s.position++
}
Expand Down
Loading