Skip to content

Commit

Permalink
Reland "Roll closure compiler"
Browse files Browse the repository at this point in the history
This is a reland of cdf4606.
Retrying to land this now that crbug.com/833656 is fixed.

Original change's description:
> Roll closure compiler
>
> Latest compiler version does not include Chrome's externs by default. They
> need to be explicitly included.
>
> Change log:
> google/closure-compiler@8fc8229...5cae9b7
> chrome.js: 7ef3422e1e87480d560247d75fee181b4cac24d9
> chrome_extensions.js: 3a0b0052782af3f0bd3a5fe10bb568cdd769db4e -> 03c824e85e7b77bde4e7449ed3727608b05b2acc
> polymer-1.0.js: 55e962227e676cd30f81439573771326933aae54 -> 8f3b8c9354813ae0e2f186bf2f504cf3f3182a66
>
> BUG=831004
>
> Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
> Change-Id: I0db559ee9a198dadd3b23e57b835cc6b985540a9
> Reviewed-on: https://chromium-review.googlesource.com/1006182
> Reviewed-by: calamity <calamity@chromium.org>
> Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#551058}

TBR=calamity

Bug: 831004
Change-Id: I0966b1a07da3b6318fb22a6bc6393eb499446743
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/1015180
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551445}
  • Loading branch information
freshp86 authored and Commit Bot committed Apr 17, 2018
1 parent f58eccd commit 9d78844
Show file tree
Hide file tree
Showing 15 changed files with 1,729 additions and 1,455 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'<(DEPTH)/chrome/browser/resources/bookmark_manager/js/dnd.js',
'<(DEPTH)/chrome/browser/resources/bookmark_manager/js/main.js',
'<(DEPTH)/third_party/closure_compiler/externs/bookmark_manager_private.js',
'<(DEPTH)/third_party/closure_compiler/externs//chrome.js',
'<(DEPTH)/third_party/closure_compiler/externs//chrome_send.js',
'<(DEPTH)/third_party/closure_compiler/externs//chrome_extensions.js',
'<(DEPTH)/third_party/closure_compiler/externs//metrics_private.js',
Expand Down
34 changes: 17 additions & 17 deletions chrome/browser/resources/md_bookmarks/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cr.define('bookmarks', function() {

/**
* @param {SelectionState} selectionState
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.selectItems = function(selectionState, action) {
Expand Down Expand Up @@ -66,7 +66,7 @@ cr.define('bookmarks', function() {

/**
* @param {SelectionState} selectionState
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.updateAnchor = function(selectionState, action) {
Expand All @@ -77,7 +77,7 @@ cr.define('bookmarks', function() {

/**
* @param {SelectionState} selection
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.updateSelection = function(selection, action) {
Expand Down Expand Up @@ -111,7 +111,7 @@ cr.define('bookmarks', function() {

/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.startSearch = function(search, action) {
Expand All @@ -124,7 +124,7 @@ cr.define('bookmarks', function() {

/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.finishSearch = function(search, action) {
Expand Down Expand Up @@ -164,7 +164,7 @@ cr.define('bookmarks', function() {

/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.updateSearch = function(search, action) {
Expand Down Expand Up @@ -199,7 +199,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.createBookmark = function(nodes, action) {
Expand All @@ -218,7 +218,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.editBookmark = function(nodes, action) {
Expand All @@ -234,7 +234,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.moveBookmark = function(nodes, action) {
Expand Down Expand Up @@ -266,7 +266,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.removeBookmark = function(nodes, action) {
Expand All @@ -283,7 +283,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.reorderChildren = function(nodes, action) {
Expand All @@ -295,7 +295,7 @@ cr.define('bookmarks', function() {

/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.updateNodes = function(nodes, action) {
Expand Down Expand Up @@ -338,7 +338,7 @@ cr.define('bookmarks', function() {

/**
* @param {string} selectedFolder
* @param {Action} action
* @param {Object} action
* @param {NodeMap} nodes
* @return {string}
*/
Expand Down Expand Up @@ -388,7 +388,7 @@ cr.define('bookmarks', function() {

/**
* @param {FolderOpenState} folderOpenState
* @param {Action} action
* @param {Object} action
* @return {FolderOpenState}
*/
FolderOpenState.changeFolderOpen = function(folderOpenState, action) {
Expand All @@ -401,7 +401,7 @@ cr.define('bookmarks', function() {

/**
* @param {FolderOpenState} folderOpenState
* @param {Action} action
* @param {Object} action
* @param {NodeMap} nodes
* @return {FolderOpenState}
*/
Expand Down Expand Up @@ -431,7 +431,7 @@ cr.define('bookmarks', function() {

/**
* @param {PreferencesState} prefs
* @param {Action} action
* @param {Object} action
* @return {PreferencesState}
*/
PreferencesState.updatePrefs = function(prefs, action) {
Expand All @@ -453,7 +453,7 @@ cr.define('bookmarks', function() {
* Root reducer for the Bookmarks page. This is called by the store in
* response to an action, and the return value is used to update the UI.
* @param {!BookmarksPageState} state
* @param {Action} action
* @param {Object} action
* @return {!BookmarksPageState}
*/
function reduceAction(state, action) {
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/resources/ntp4/compiled_resources2.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'variables': {
'script_args': ['--custom_sources'],
'source_files': [
'<(DEPTH)/third_party/closure_compiler/externs/chrome.js',
'<(DEPTH)/third_party/closure_compiler/externs/chrome_send.js',
'<(DEPTH)/third_party/jstemplate/util.js',
'<(DEPTH)/third_party/jstemplate/jsevalcontext.js',
Expand Down
2 changes: 1 addition & 1 deletion third_party/closure_compiler/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Short Name: closure-compiler
URL: http://github.com/google/closure-compiler
Version: v20150729-236-gad656a1
Date: 2015/08/26 08:46
Revision: 8fc82299c45b0a33f19834222acda4850fd77bc0
Revision: 5cae9b78a16a2655627733b66d1c686d5f547925
License: Apache 2.0
License File: LICENSE
Security Critical: no
Expand Down
2 changes: 1 addition & 1 deletion third_party/closure_compiler/closure_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ checking_closure_args = [
"jscomp_error=uselessCode",
"jscomp_error=visibility",

"language_in=ECMASCRIPT_NEXT",
"language_in=ECMASCRIPT_2017",
"language_out=ECMASCRIPT5_STRICT",

"chrome_pass",
Expand Down
2 changes: 1 addition & 1 deletion third_party/closure_compiler/closure_args.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'jscomp_error=uselessCode',
'jscomp_error=visibility',

'language_in=ECMASCRIPT_NEXT',
'language_in=ECMASCRIPT_2017',
'language_out=ECMASCRIPT5_STRICT',

'checks_only',
Expand Down
2 changes: 2 additions & 0 deletions third_party/closure_compiler/compile_js.gni
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ script_path = "//third_party/closure_compiler"
compiler_path = "$script_path/compiler/compiler.jar"
externs_path = "$script_path/externs"
interfaces_path = "$script_path/interfaces"
chrome_externs = "$externs_path/chrome.js"
polymer_externs = "$externs_path/polymer-1.0.js"

# Defines a target that creates an ordering for .js files to be used by
Expand Down Expand Up @@ -202,6 +203,7 @@ template("js_binary") {
args += [ "--flags" ] + closure_flags
args += [
"--externs",
rebase_path("$chrome_externs", root_build_dir),
rebase_path("$polymer_externs", root_build_dir),
]
if (defined(externs_list)) {
Expand Down
Binary file modified third_party/closure_compiler/compiler/compiler.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion third_party/closure_compiler/compiler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
_CR_JS = os.path.join(_RESOURCES_DIR, "cr.js")
_CR_UI_JS = os.path.join(_RESOURCES_DIR, "cr", "ui.js")
_PROMISE_RESOLVER_JS = os.path.join(_RESOURCES_DIR, "promise_resolver.js")
_CHROME_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler",
"externs", "chrome.js")
_CHROME_SEND_EXTERNS = os.path.join(_SRC_DIR, "third_party", "closure_compiler",
"externs", "chrome_send.js")
_CLOSURE_ARGS_GYPI = os.path.join(_SCRIPT_DIR, "closure_args.gypi")
Expand Down Expand Up @@ -51,7 +53,7 @@ def _runChecker(self, source_code, needs_output, closure_args=None):
if needs_output:
args.remove("checks_only")

sources = [file_path, _CHROME_SEND_EXTERNS]
sources = [file_path, _CHROME_EXTERNS, _CHROME_SEND_EXTERNS]
found_errors, stderr = self._checker.check(sources,
out_file=out_file,
closure_args=args)
Expand Down
Loading

0 comments on commit 9d78844

Please sign in to comment.