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

Unified Diff: Source/devtools/front_end/externs.js

Issue 334393004: DevTools: Always construct CodeMirror explicitly, via "new" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/externs.js
diff --git a/Source/devtools/front_end/externs.js b/Source/devtools/front_end/externs.js
index fa104564c44f0e9a4a24f7e110ef45babb0e7eaf..5bcbdcfba89fca8b489a0bd5a40e60eb5845a03f 100644
--- a/Source/devtools/front_end/externs.js
+++ b/Source/devtools/front_end/externs.js
@@ -34,18 +34,11 @@
Event.prototype.isMetaOrCtrlForTest;
/**
- * @constructor
- * @extends {KeyboardEvent}
- * @param {string} eventType
- * @param {!Object=} properties
- */
-window.KeyboardEvent = function(eventType, properties) {}
-
-/**
* @type {number}
*/
KeyboardEvent.DOM_KEY_LOCATION_NUMPAD;
+// FIXME: Remove after the Closure compiler roll.
/** @param {*} message */
function postMessage(message) {}
@@ -315,11 +308,23 @@ difflib.SequenceMatcher = function(baseText, newText) { }
difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; }
/** @constructor */
-var CodeMirror = function() { }
+var Doc = function() { }
+Doc.prototype = {
+ /** @type {number} */
+ scrollLeft: 0,
+ /** @type {number} */
+ scrollTop: 0
+}
+
+/** @constructor */
+var CodeMirror = function(element, config) { }
CodeMirror.on = function(obj, type, handler) { }
CodeMirror.prototype = {
+ /** @type {!Doc} */
+ doc: null,
addKeyMap: function(map) { },
addLineClass: function(handle, where, cls) { },
+ /** @param {?Object=} options */
addLineWidget: function(handle, node, options) { },
/**
* @param {string|!Object} spec
@@ -331,11 +336,17 @@ CodeMirror.prototype = {
clearGutter: function(gutterID) { },
clearHistory: function() { },
clipPos: function(pos) { },
+ /** @param {string=} mode */
coordsChar: function(coords, mode) { },
+ /** @param {string=} mode */
cursorCoords: function(start, mode) { },
defaultCharWidth: function() { },
defaultTextHeight: function() { },
deleteH: function(dir, unit) { },
+ /**
+ * @param {*=} to
+ * @param {*=} op
+ */
eachLine: function(from, to, op) { },
execCommand: function(cmd) { },
extendSelection: function(from, to) { },
@@ -360,6 +371,7 @@ CodeMirror.prototype = {
getLineNumber: function(line) { },
getMode: function() { },
getOption: function(option) { },
+ /** @param {*=} lineSep */
getRange: function(from, to, lineSep) { },
/**
* @return {!{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
@@ -370,6 +382,7 @@ CodeMirror.prototype = {
getSelections: function() { },
getStateAfter: function(line) { },
getTokenAt: function(pos) { },
+ /** @param {*=} lineSep */
getValue: function(lineSep) { },
getViewport: function() { },
getWrapperElement: function() { },
@@ -405,8 +418,10 @@ CodeMirror.prototype = {
removeLineClass: function(handle, where, cls) { },
removeLineWidget: function(widget) { },
removeOverlay: function(spec) { },
+ /** @param {*=} origin */
replaceRange: function(code, from, to, origin) { },
replaceSelection: function(code, collapse, origin) { },
+ /** @param {*=} margin */
scrollIntoView: function(pos, margin) { },
scrollTo: function(x, y) { },
setBookmark: function(pos, options) { },
@@ -417,7 +432,11 @@ CodeMirror.prototype = {
setLine: function(line, text) { },
setOption: function(option, value) { },
setSelection: function(anchor, head) { },
- setSelections: function(selections) { },
+ /**
+ * @param {number=} primaryIndex
+ * @param {?Object=} config
+ */
+ setSelections: function(selections, primaryIndex, config) { },
setSize: function(width, height) { },
setValue: function(code) { },
somethingSelected: function() { },
@@ -427,6 +446,7 @@ CodeMirror.prototype = {
}
/** @type {!{cursorDiv: Element}} */
CodeMirror.prototype.display;
+/** @type {!Object} */
CodeMirror.Pass;
CodeMirror.showHint = function(codeMirror, hintintFunction) { };
CodeMirror.commands = {};
@@ -439,9 +459,9 @@ CodeMirror.startState = function(mode) { };
/** @constructor */
CodeMirror.Pos = function(line, ch) { }
-/** type {number} */
+/** @type {number} */
CodeMirror.Pos.prototype.line;
-/** type {number} */
+/** @type {number} */
CodeMirror.Pos.prototype.ch;
/** @constructor */
« no previous file with comments | « no previous file | Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698