Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2237)

Unified Diff: Source/devtools/scripts/jsdoc-validator/tests/document.js

Issue 659973003: [DevTools] Disallow use of global property "document". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/scripts/jsdoc-validator/tests/document.js
diff --git a/Source/devtools/scripts/jsdoc-validator/tests/document.js b/Source/devtools/scripts/jsdoc-validator/tests/document.js
new file mode 100644
index 0000000000000000000000000000000000000000..a6fcf6399bf8bcf3e019b459d3fc499ec0cc8781
--- /dev/null
+++ b/Source/devtools/scripts/jsdoc-validator/tests/document.js
@@ -0,0 +1,65 @@
+document.bar();
+window.document.bar();
+bar.document();
+bar.window.document();
+document();
+var x = window.document;
+
+function a(document) {
+ document.bar();
+ document();
+
+ function inner() {
+ var y = document;
+ }
+}
+
+function b(bar) {
+ document.bar();
+ document();
+ var document = bar;
+}
+
+function c(bar) {
+ document.bar();
+ document();
+ var inner = document + bar;
+}
+
+function d(window) {
+ window.document();
+ window.document.bar = 2;
+}
+
+/**
+ * @suppressGlobalPropertiesCheck
+ * @param {string} param
+ */
+function e(param) {
+ document;
+ window.document;
+}
+
+/**
+ * @param {string} param
+ */
+function f(param) {
+ document;
+ window.document;
+}
+
+var y = x.document;
+window.x.document();
+var z = document.document;
+var bar = window + window.document;
+
+self.document = bar;
+self.addEventListener();
+self.removeEventListener();
+
+function g() {
+ var self = this;
+ self.document;
+}
+
+function h() { var a = { document: true }; }

Powered by Google App Engine
This is Rietveld 408576698