Commit cdf4606b authored by dpapad's avatar dpapad Committed by Commit Bot

Roll closure compiler

Latest compiler version does not include Chrome's externs by default. They
need to be explicitly included.

Change log:
https://github.com/google/closure-compiler/compare/8fc82299c45b0a33f19834222acda4850fd77bc0...5cae9b78a16a2655627733b66d1c686d5f547925
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/1006182Reviewed-by: default avatarcalamity <calamity@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551058}
parent 1ad77242
......@@ -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',
......
......@@ -14,7 +14,7 @@ cr.define('bookmarks', function() {
/**
* @param {SelectionState} selectionState
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.selectItems = function(selectionState, action) {
......@@ -66,7 +66,7 @@ cr.define('bookmarks', function() {
/**
* @param {SelectionState} selectionState
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.updateAnchor = function(selectionState, action) {
......@@ -77,7 +77,7 @@ cr.define('bookmarks', function() {
/**
* @param {SelectionState} selection
* @param {Action} action
* @param {Object} action
* @return {SelectionState}
*/
SelectionState.updateSelection = function(selection, action) {
......@@ -111,7 +111,7 @@ cr.define('bookmarks', function() {
/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.startSearch = function(search, action) {
......@@ -124,7 +124,7 @@ cr.define('bookmarks', function() {
/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.finishSearch = function(search, action) {
......@@ -164,7 +164,7 @@ cr.define('bookmarks', function() {
/**
* @param {SearchState} search
* @param {Action} action
* @param {Object} action
* @return {SearchState}
*/
SearchState.updateSearch = function(search, action) {
......@@ -199,7 +199,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.createBookmark = function(nodes, action) {
......@@ -218,7 +218,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.editBookmark = function(nodes, action) {
......@@ -234,7 +234,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.moveBookmark = function(nodes, action) {
......@@ -266,7 +266,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.removeBookmark = function(nodes, action) {
......@@ -283,7 +283,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.reorderChildren = function(nodes, action) {
......@@ -295,7 +295,7 @@ cr.define('bookmarks', function() {
/**
* @param {NodeMap} nodes
* @param {Action} action
* @param {Object} action
* @return {NodeMap}
*/
NodeState.updateNodes = function(nodes, action) {
......@@ -338,7 +338,7 @@ cr.define('bookmarks', function() {
/**
* @param {string} selectedFolder
* @param {Action} action
* @param {Object} action
* @param {NodeMap} nodes
* @return {string}
*/
......@@ -388,7 +388,7 @@ cr.define('bookmarks', function() {
/**
* @param {FolderOpenState} folderOpenState
* @param {Action} action
* @param {Object} action
* @return {FolderOpenState}
*/
FolderOpenState.changeFolderOpen = function(folderOpenState, action) {
......@@ -401,7 +401,7 @@ cr.define('bookmarks', function() {
/**
* @param {FolderOpenState} folderOpenState
* @param {Action} action
* @param {Object} action
* @param {NodeMap} nodes
* @return {FolderOpenState}
*/
......@@ -431,7 +431,7 @@ cr.define('bookmarks', function() {
/**
* @param {PreferencesState} prefs
* @param {Action} action
* @param {Object} action
* @return {PreferencesState}
*/
PreferencesState.updatePrefs = function(prefs, action) {
......@@ -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) {
......
......@@ -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',
......
......@@ -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
......
......@@ -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",
......
......@@ -36,7 +36,7 @@
'jscomp_error=uselessCode',
'jscomp_error=visibility',
'language_in=ECMASCRIPT_NEXT',
'language_in=ECMASCRIPT_2017',
'language_out=ECMASCRIPT5_STRICT',
'checks_only',
......
......@@ -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
......@@ -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)) {
......
......@@ -19,6 +19,8 @@ _ASSERT_JS = os.path.join(_RESOURCES_DIR, "assert.js")
_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")
......@@ -51,7 +53,7 @@ class CompilerTest(unittest.TestCase):
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)
......
This diff is collapsed.
......@@ -10,82 +10,110 @@
'targets': [
{
'target_name': 'accessibility_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'autofill_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'automation',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'bluetooth',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'bluetooth_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'bookmark_manager_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'chrome',
'includes': ['../include_js.gypi'],
},
{
'target_name': 'chrome_extensions',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'chrome_send',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'clipboard',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'command_line_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'developer_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'file_manager_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'input_method_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'language_settings_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'management',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'media_player_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'metrics_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'mime_handler_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'mojo',
'includes': ['../include_js.gypi'],
},
{
'target_name': 'networking_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'passwords_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
......@@ -98,22 +126,27 @@
},
{
'target_name': 'quick_unlock_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'settings_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'system_display',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'system_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
'target_name': 'users_private',
'dependencies': ['chrome'],
'includes': ['../include_js.gypi'],
},
{
......
......@@ -175,6 +175,21 @@ PolymerElement.prototype.hostAttributes;
*/
PolymerElement.prototype.listeners;
/**
* Force this element to distribute its children to its local dom.
* A user should call `distributeContent` if distribution has been
* invalidated due to changes to selectors on child elements that
* effect distribution that were not made via `Polymer.dom`.
* For example, if an element contains an insertion point with
* `<content select=".foo">` and a `foo` class is added to a child,
* then `distributeContent` must be called to update
* local dom distribution.
* @param {boolean} updateInsertionPoints Shady DOM does not detect
* <content> insertion that is nested in a sub-tree being appended.
* Set to true to distribute to newly added nested <content>'s.
*/
PolymerElement.prototype.distributeContent = function(updateInsertionPoints) {};
/**
* Return the element whose local dom within which this element is contained.
* @type {?Element}
......@@ -580,6 +595,13 @@ Polymer.Base.get = function(path, root) {};
*/
Polymer.Base.fire = function(type, detail, options) {};
/**
* For Polymer internal use only, except for
* github.com/Polymer/polymer/issues/4138
* @type {!function (!Node, ?string, *, ?Object)}
*/
Polymer.Base._computeFinalAnnotationValue;
/**
* @param {...*} var_args
* For Polymer-internal use only.
......@@ -628,6 +650,12 @@ Polymer.Gestures.findOriginalTarget = function(ev) {};
*/
Polymer.Gestures.gestures = {};
/**
* @param {Node} node
* @param {string} value
*/
Polymer.Gestures.setTouchAction = function(node, value) {};
/**
* @type {!Object}
*/
......@@ -1166,7 +1194,7 @@ Polymer.Collection.applySplices = function(userArray, splices) {};
/**
* Settings pulled from
* https://github.com/Polymer/polymer/blob/master/src/lib/settings.html
* https://github.com/Polymer/polymer/blob/master/lib/utils/settings.html
* @const
*/
Polymer.Settings = {};
......@@ -1195,6 +1223,9 @@ Polymer.Settings.useNativeImports;
/** @type {boolean} */
Polymer.Settings.useNativeCustomElements;
/** @type {boolean} */
Polymer.Settings.useNativeCSSProperties;
/**
* @see https://github.com/Polymer/polymer/blob/master/src/lib/template/templatizer.html
......@@ -1211,8 +1242,10 @@ Polymer.Templatizer = {
/**
* @param {?Element} template
* @param {boolean=} mutableData In Polymer 1.x, passing this argument is a
* no-op.
*/
templatize: function(template) {},
templatize: function(template, mutableData) {},
/**
* Returns the template "model" associated with a given element, which
......@@ -1255,6 +1288,24 @@ var TemplatizerNode = function() {};
TemplatizerNode.prototype._templateInstance;
/**
* @see https://github.com/Polymer/polymer/blob/1.x/src/lib/template/dom-if.html
* @extends {PolymerElement}
* @constructor
*/
var DomIf = function() {};
/**
* Forces the element to render its content. Normally rendering is
* asynchronous to a provoking change. This is done for efficiency so
* that multiple changes trigger only a single render. The render method
* should be called if, for example, template rendering is required to
* validate application state.
*/
DomIf.prototype.render = function() {};
/**
* @see https://github.com/Polymer/polymer/blob/master/src/lib/template/dom-repeat.html
......@@ -1643,6 +1694,25 @@ Polymer.DomModule = function() {};
*/
Polymer.DomModule.import = function(id, opt_selector) {};
/** @const */
Polymer.Path = {
/**
* @param {string=} base
* @param {string=} newBase
* @param {string=} path
* @return {string}
*/
translate: function(base, newBase, path) {},
/**
* @param {string=} base
* @param {string=} wildcard
* @param {string=} path
* @return {boolean}
*/
matches: function(base, wildcard, path) {}
};
/**
* For compatibility with both Polymer 1.0 and 2.0, code may check for certain
* objects and properties which don't exist in Polymer 1.0.
......@@ -1654,3 +1724,24 @@ Polymer.DomModule.import = function(id, opt_selector) {};
/** @type {undefined} */
var ShadyDOM;
Polymer.flush;
Polymer.enqueueDebouncer;
Polymer.Async.animationFrame;
Polymer.Async.idlePeriod;
Polymer.Async.microTask;
Polymer.Debouncer.debounce;
Polymer.Templatizer.mutableData;
Polymer.Templatizer.parentModel;
Polymer.Templatizer.forwardHostProp;
Polymer.Templatizer.notifyInstanceProp;
Polymer.Templatizer._setPendingPropertyOrPath;
Polymer.Templatizer._setPendingProperty;
Polymer.Templatizer._instanceProps;
/**
* @param {number} index
* @return {boolean}
*/
ArraySelectorElement.prototype.isIndexSelected = function(index) {};
......@@ -27,6 +27,7 @@ get_sha1() {
trap cleanup SIGINT SIGHUP SIGTERM
old_head=$(egrep -o "^Revision: [0-9a-f]{5,40}$" "${README}" | cut -d" " -f2)
old_chrome_sha1=$(get_sha1 "${EXTERNS_DIR}/chrome.js")
old_extensions_sha1=$(get_sha1 "${EXTERNS_DIR}/chrome_extensions.js")
old_polymer_sha1=$(get_sha1 "${EXTERNS_DIR}/polymer-1.0.js")
......@@ -69,7 +70,7 @@ check_jdk_version() {
}
echo "Checking JDK Version Used to Build"
check_jdk_version 1.7 pom.xml
check_jdk_version 1.8 pom.xml
echo "Building Closure Compiler"
mvn clean install -DskipTests=true --projects com.google.javascript:closure-compiler,com.google.javascript:closure-compiler-externs
......@@ -103,9 +104,15 @@ readonly WARNING="$(cat <<EOT
EOT
)"
(echo "${WARNING}" && cat contrib/externs/chrome.js) > "${EXTERNS_DIR}/chrome.js"
(echo "${WARNING}" && cat contrib/externs/chrome_extensions.js) > "${EXTERNS_DIR}/chrome_extensions.js"
(echo "${WARNING}" && cat contrib/externs/polymer-1.0.js) > "${EXTERNS_DIR}/polymer-1.0.js"
new_chrome_sha1=$(get_sha1 "${EXTERNS_DIR}/chrome.js")
if [[ "${new_chrome_sha1}" != "${old_chrome_sha1}" ]]; then
chrome_range="chrome.js: ${old_chrome_sha1} -> ${new_chrome_sha1}"
fi
new_extensions_sha1=$(get_sha1 "${EXTERNS_DIR}/chrome_extensions.js")
if [[ "${new_extensions_sha1}" != "${old_extensions_sha1}" ]]; then
extensions_range="chrome_extensions.js: ${old_extensions_sha1} -> ${new_extensions_sha1}"
......@@ -125,6 +132,10 @@ echo "@ closure-compiler.git HEAD:"
echo "@ Old: ${old_head}"
echo "@ New: ${new_head}"
echo "@"
echo "@ externs/chrome.js SHA1:"
echo "@ Old: ${old_chrome_sha1}"
echo "@ New: ${new_chrome_sha1}"
echo "@"
echo "@ externs/chrome_extensions.js SHA1:"
echo "@ Old: ${old_extensions_sha1}"
echo "@ New: ${new_extensions_sha1}"
......@@ -141,6 +152,7 @@ sed -i "s/^Revision: ${old_head}$/Revision: ${new_head}/" "${README}"
echo "git commit -a -m 'Roll closure compiler"
echo
echo "${head_range}"
if [[ ! -z "${chrome_range}" ]]; then echo "${chrome_range}"; fi
if [[ ! -z "${extensions_range}" ]]; then echo "${extensions_range}"; fi
if [[ ! -z "${polymer_range}" ]]; then echo "${polymer_range}"; fi
echo
......
......@@ -33,18 +33,39 @@ _INCLUDE_TEMPLATE = """
}""".lstrip()
_TARGET_TEMPLATE_NO_CHROME_DEPENDENCY = """
{
'target_name': '%s',
'includes': ['%s'],
}"""
_TARGET_TEMPLATE = """
{
'target_name': '%s',
'dependencies': ['chrome'],
'includes': ['%s'],
}"""
# Add externs files that do not depend on chrome.* namespace here. Everything
# else will have chrome.js as a dependency.
NO_CHROME_DEPENDENCY = set([
'chrome.js',
'mojo.js',
'pending.js',
'polymer-1.0.js',
'web_animations.js',
])
def CreateIncludeGyp(directory):
include_path = os.path.normpath(os.path.relpath(_INCLUDE_GYPI, directory))
js_files = [f for f in os.listdir(directory) if f.endswith('.js')]
js_files.sort()
targets = [_TARGET_TEMPLATE % (f[:-3], include_path) for f in js_files]
targets = []
for f in js_files:
template = (_TARGET_TEMPLATE_NO_CHROME_DEPENDENCY if f in
NO_CHROME_DEPENDENCY else _TARGET_TEMPLATE)
targets.append(template % (f[:-3], include_path))
return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment