Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for the nullish coalescing operator ?? #11997

Merged
merged 1 commit into from
Jun 12, 2020
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
6 changes: 6 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ function createWebpackConfig(defines, output) {
options: {
presets: skipBabel ? undefined : ["@babel/preset-env"],
plugins: [
[
"@babel/plugin-proposal-nullish-coalescing-operator",
{
loose: true,
},
],
"@babel/plugin-transform-modules-commonjs",
[
"@babel/plugin-transform-runtime",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.0.0",
"devDependencies": {
"@babel/core": "^7.10.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.1",
Expand Down
4 changes: 2 additions & 2 deletions web/pdf_thumbnail_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,15 @@ class PDFThumbnailView {
get _thumbPageTitle() {
return this.l10n.get(
"thumb_page_title",
{ page: this.pageLabel !== null ? this.pageLabel : this.id },
{ page: this.pageLabel ?? this.id },
"Page {{page}}"
);
}

get _thumbPageCanvas() {
return this.l10n.get(
"thumb_page_canvas",
{ page: this.pageLabel !== null ? this.pageLabel : this.id },
{ page: this.pageLabel ?? this.id },
"Thumbnail of Page {{page}}"
);
}
Expand Down