summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-04 23:45:20 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-04 23:45:20 +0000
commit7afe65596e62a040d7f74df0d73c05b6fc417fdc (patch)
tree8518fe1517d42dcf04457ee4b3b2f204e81ba096 /third_party
parent6486088e8bb6dc810157503edfa3c75a58e9e49d (diff)
downloadchromium_src-7afe65596e62a040d7f74df0d73c05b6fc417fdc.zip
chromium_src-7afe65596e62a040d7f74df0d73c05b6fc417fdc.tar.gz
chromium_src-7afe65596e62a040d7f74df0d73c05b6fc417fdc.tar.bz2
Typecheck some of ui/webui/resources/js/ with Closure compiler.
Also adds: assertNotReached("message"); as a rough equivalent of NOTREACHED() << "message"; in Chromium and: ASSERT_NOT_REACHED(); in blink. R=arv@chromium.org BUG=393873 TEST=gyp --depth . ui/webui/resources/js/compiled_resources.gyp ui/webui/resources/js/chromeos/compiled_resources.gyp && ninja -C out/Default/ Review URL: https://codereview.chromium.org/405743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/closure_compiler/checker.py2
-rw-r--r--third_party/closure_compiler/externs/chrome_send_externs.js14
-rw-r--r--third_party/closure_compiler/externs/pending_compiler_externs.js15
3 files changed, 31 insertions, 0 deletions
diff --git a/third_party/closure_compiler/checker.py b/third_party/closure_compiler/checker.py
index 0df60e6..26382ce 100644
--- a/third_party/closure_compiler/checker.py
+++ b/third_party/closure_compiler/checker.py
@@ -94,6 +94,8 @@ class Checker(object):
"--jscomp_error=unknownDefines",
"--jscomp_error=uselessCode",
"--jscomp_error=visibility",
+ # TODO(dbeam): happens when the same file is <include>d multiple times.
+ "--jscomp_off=duplicate",
]
_found_java = False
diff --git a/third_party/closure_compiler/externs/chrome_send_externs.js b/third_party/closure_compiler/externs/chrome_send_externs.js
new file mode 100644
index 0000000..3d55f18
--- /dev/null
+++ b/third_party/closure_compiler/externs/chrome_send_externs.js
@@ -0,0 +1,14 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Externs for global |chrome| object.
+ * @externs
+ */
+
+/**
+ * @param {string} msg
+ * @param {Array=} opt_args
+ */
+chrome.send = function(msg, opt_args) {};
diff --git a/third_party/closure_compiler/externs/pending_compiler_externs.js b/third_party/closure_compiler/externs/pending_compiler_externs.js
new file mode 100644
index 0000000..9945b2e
--- /dev/null
+++ b/third_party/closure_compiler/externs/pending_compiler_externs.js
@@ -0,0 +1,15 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Temporary externs until compiler/compiler.jar catches up.
+ * @externs
+ */
+
+/**
+ * @see http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
+ * @param {string=} opt_title The title to give the new HTML document.
+ * @return {!HTMLDocument}
+ */
+DOMImplementation.prototype.createHTMLDocument = function(opt_title) {};