Skip to content

Commit

Permalink
gesture fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Apr 27, 2017
1 parent fa9823f commit 346e2d5
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 350 deletions.
333 changes: 2 additions & 331 deletions closure.log
Original file line number Diff line number Diff line change
Expand Up @@ -717,336 +717,7 @@ Found : PolymerElement
* @param {Polymer.Debouncer?} debouncer Debouncer object.
^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:246: WARNING - Returned type does not match declared return type.
Expected : HTMLElement|null
Found : Element|null
More details:
The found type is a union that includes an unexpected type: Element
return node;
^^^^^^^^^^^^

/polymer.html_script_13.js:258: WARNING - Returned type does not match declared return type.
Expected : HTMLElement|null
Found : Document|Element|ShadowRoot|Window
More details:
The found type is a union that includes an unexpected type: Window
return ev.composedPath()[0];
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:261: WARNING - Returned type does not match declared return type.
Expected : HTMLElement|null
Found : EventTarget|null
More details:
The found type is a union that includes an unexpected type: EventTarget
return ev.target;
^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:283: WARNING - Property changedTouches never defined on ev of type Event
let t = ev.changedTouches[0];
^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:286: WARNING - Property touches never defined on ev of type Event
if (ev.touches.length === 1) {
^^^^^^^^^^

/polymer.html_script_13.js:330: WARNING - Property changedTouches never defined on ev of type Event
let t = ev.changedTouches[0];
^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:371: WARNING - Missing return statement. Function expected to return boolean.
addListener: function(node, evType, handler) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:372: WARNING - Dangerous use of the global THIS object
if (this.gestures[evType]) {
^^^^

/polymer.html_script_13.js:373: WARNING - Dangerous use of the global THIS object
this._add(node, evType, handler);
^^^^

/polymer.html_script_13.js:388: WARNING - Missing return statement. Function expected to return boolean.
removeListener: function(node, evType, handler) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_13.js:389: WARNING - Dangerous use of the global THIS object
if (this.gestures[evType]) {
^^^^

/polymer.html_script_13.js:390: WARNING - Dangerous use of the global THIS object
this._remove(node, evType, handler);
^^^^

/polymer.html_script_13.js:401: WARNING - Bad type annotation. missing opening ( See https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation for more information.
* @param {function} handler Event handler function.
^

/polymer.html_script_13.js:404: WARNING - Dangerous use of the global THIS object
let recognizer = this.gestures[evType];
^^^^

/polymer.html_script_13.js:422: WARNING - Dangerous use of the global THIS object
node.addEventListener(dep, this._handleNative);
^^^^

/polymer.html_script_13.js:429: WARNING - Dangerous use of the global THIS object
this.setTouchAction(node, recognizer.touchAction);
^^^^

/polymer.html_script_13.js:439: WARNING - Bad type annotation. missing opening ( See https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation for more information.
* @param {function} handler Event handler function.
^

/polymer.html_script_13.js:442: WARNING - Dangerous use of the global THIS object
let recognizer = this.gestures[evType];
^^^^

/polymer.html_script_13.js:454: WARNING - Dangerous use of the global THIS object
node.removeEventListener(dep, this._handleNative);
^^^^

/polymer.html_script_13.js:470: WARNING - Dangerous use of the global THIS object
this.recognizers.push(recog);
^^^^

/polymer.html_script_13.js:472: WARNING - Dangerous use of the global THIS object
this.gestures[recog.emits[i]] = recog;
^^^^

/polymer.html_script_13.js:482: WARNING - Dangerous use of the global THIS object
for (let i = 0, r; i < this.recognizers.length; i++) {
^^^^

/polymer.html_script_13.js:483: WARNING - Dangerous use of the global THIS object
r = this.recognizers[i];
^^^^

/polymer.html_script_13.js:506: WARNING - Property style never defined on node of type Node
node.style.touchAction = value;
^^^^^^^^^^

/polymer.html_script_13.js:539: WARNING - Dangerous use of the global THIS object
let recognizer = this._findRecognizerByEvent(evName);
^^^^

/polymer.html_script_13.js:576: WARNING - Dangerous use of the global THIS object
untrackDocument(this.info);
^^^^

/polymer.html_script_13.js:597: WARNING - Dangerous use of the global THIS object
trackDocument(this.info, movefn, upfn);
^^^^

/polymer.html_script_13.js:598: WARNING - Dangerous use of the global THIS object
this._fire('down', t, e);
^^^^

/polymer.html_script_13.js:601: WARNING - Dangerous use of the global THIS object
this._fire('down', Gestures._findOriginalTarget(e), e.changedTouches[0], e);
^^^^

/polymer.html_script_13.js:604: WARNING - Dangerous use of the global THIS object
this._fire('up', Gestures._findOriginalTarget(e), e.changedTouches[0], e);
^^^^

/polymer.html_script_13.js:636: WARNING - Dangerous use of the global THIS object
if (this.moves.length > TRACK_LENGTH) {
^^^^

/polymer.html_script_13.js:637: WARNING - Dangerous use of the global THIS object
this.moves.shift();
^^^^

/polymer.html_script_13.js:639: WARNING - Dangerous use of the global THIS object
this.moves.push(move);
^^^^

/polymer.html_script_13.js:647: WARNING - Dangerous use of the global THIS object
this.info.state = 'start';
^^^^

/polymer.html_script_13.js:648: WARNING - Dangerous use of the global THIS object
this.info.started = false;
^^^^

/polymer.html_script_13.js:649: WARNING - Dangerous use of the global THIS object
this.info.moves = [];
^^^^

/polymer.html_script_13.js:650: WARNING - Dangerous use of the global THIS object
this.info.x = 0;
^^^^

/polymer.html_script_13.js:651: WARNING - Dangerous use of the global THIS object
this.info.y = 0;
^^^^

/polymer.html_script_13.js:652: WARNING - Dangerous use of the global THIS object
this.info.prevent = false;
^^^^

/polymer.html_script_13.js:653: WARNING - Dangerous use of the global THIS object
untrackDocument(this.info);
^^^^

/polymer.html_script_13.js:657: WARNING - Dangerous use of the global THIS object
if (this.info.prevent) {
^^^^

/polymer.html_script_13.js:660: WARNING - Dangerous use of the global THIS object
if (this.info.started) {
^^^^

/polymer.html_script_13.js:663: WARNING - Dangerous use of the global THIS object
let dx = Math.abs(this.info.x - x);
^^^^

/polymer.html_script_13.js:664: WARNING - Dangerous use of the global THIS object
let dy = Math.abs(this.info.y - y);
^^^^

/polymer.html_script_13.js:702: WARNING - Dangerous use of the global THIS object
trackDocument(this.info, movefn, upfn);
^^^^

/polymer.html_script_13.js:703: WARNING - Dangerous use of the global THIS object
this.info.x = e.clientX;
^^^^

/polymer.html_script_13.js:704: WARNING - Dangerous use of the global THIS object
this.info.y = e.clientY;
^^^^

/polymer.html_script_13.js:709: WARNING - Dangerous use of the global THIS object
this.info.x = ct.clientX;
^^^^

/polymer.html_script_13.js:710: WARNING - Dangerous use of the global THIS object
this.info.y = ct.clientY;
^^^^

/polymer.html_script_13.js:717: WARNING - Dangerous use of the global THIS object
if (this.hasMovedEnough(x, y)) {
^^^^

/polymer.html_script_13.js:718: WARNING - Dangerous use of the global THIS object
if (this.info.state === 'start') {
^^^^

/polymer.html_script_13.js:722: WARNING - Dangerous use of the global THIS object
this.info.addMove({x: x, y: y});
^^^^

/polymer.html_script_13.js:723: WARNING - Dangerous use of the global THIS object
this._fire(t, ct);
^^^^

/polymer.html_script_13.js:724: WARNING - Dangerous use of the global THIS object
this.info.state = 'track';
^^^^

/polymer.html_script_13.js:725: WARNING - Dangerous use of the global THIS object
this.info.started = true;
^^^^

/polymer.html_script_13.js:733: WARNING - Dangerous use of the global THIS object
if (this.info.started) {
^^^^

/polymer.html_script_13.js:735: WARNING - Dangerous use of the global THIS object
this.info.state = 'end';
^^^^

/polymer.html_script_13.js:736: WARNING - Dangerous use of the global THIS object
this.info.addMove({x: ct.clientX, y: ct.clientY});
^^^^

/polymer.html_script_13.js:737: WARNING - Dangerous use of the global THIS object
this._fire(t, ct, e);
^^^^

/polymer.html_script_13.js:742: WARNING - Dangerous use of the global THIS object
let secondlast = this.info.moves[this.info.moves.length - 2];
^^^^

/polymer.html_script_13.js:742: WARNING - Dangerous use of the global THIS object
let secondlast = this.info.moves[this.info.moves.length - 2];
^^^^

/polymer.html_script_13.js:743: WARNING - Dangerous use of the global THIS object
let lastmove = this.info.moves[this.info.moves.length - 1];
^^^^

/polymer.html_script_13.js:743: WARNING - Dangerous use of the global THIS object
let lastmove = this.info.moves[this.info.moves.length - 1];
^^^^

/polymer.html_script_13.js:744: WARNING - Dangerous use of the global THIS object
let dx = lastmove.x - this.info.x;
^^^^

/polymer.html_script_13.js:745: WARNING - Dangerous use of the global THIS object
let dy = lastmove.y - this.info.y;
^^^^

/polymer.html_script_13.js:752: WARNING - Dangerous use of the global THIS object
state: this.info.state,
^^^^

/polymer.html_script_13.js:782: WARNING - Dangerous use of the global THIS object
this.info.x = NaN;
^^^^

/polymer.html_script_13.js:783: WARNING - Dangerous use of the global THIS object
this.info.y = NaN;
^^^^

/polymer.html_script_13.js:784: WARNING - Dangerous use of the global THIS object
this.info.prevent = false;
^^^^

/polymer.html_script_13.js:787: WARNING - Dangerous use of the global THIS object
this.info.x = e.clientX;
^^^^

/polymer.html_script_13.js:788: WARNING - Dangerous use of the global THIS object
this.info.y = e.clientY;
^^^^

/polymer.html_script_13.js:793: WARNING - Dangerous use of the global THIS object
this.save(e);
^^^^

/polymer.html_script_13.js:798: WARNING - Dangerous use of the global THIS object
this.forward(e);
^^^^

/polymer.html_script_13.js:803: WARNING - Dangerous use of the global THIS object
this.save(e.changedTouches[0], e);
^^^^

/polymer.html_script_13.js:806: WARNING - Dangerous use of the global THIS object
this.forward(e.changedTouches[0], e);
^^^^

/polymer.html_script_13.js:810: WARNING - Dangerous use of the global THIS object
let dx = Math.abs(e.clientX - this.info.x);
^^^^

/polymer.html_script_13.js:811: WARNING - Dangerous use of the global THIS object
let dy = Math.abs(e.clientY - this.info.y);
^^^^

/polymer.html_script_13.js:816: WARNING - Dangerous use of the global THIS object
if (!this.info.prevent) {
^^^^

/polymer.html_script_14.js:6: WARNING - All constants must be typed. The compiler could not infer the type of constant gestures. Please use an explicit type annotation. For more information, see:
https://github.com/google/closure-compiler/wiki/Using-NTI-(new-type-inference)#warnings-about-uninferred-constants
const gestures = Polymer.Gestures;
^^^^^^^^^^^^^^^^^^^^^^^^^^^

/polymer.html_script_14.js:28: WARNING - GestureEventListeners extends non-object type ?.
/polymer.html_script_14.js:31: WARNING - GestureEventListeners extends non-object type ?.

class GestureEventListeners extends superClass {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -1839,4 +1510,4 @@ externs/closure-types.js:759: WARNING - property toggle on interface Polymer_Arr
Polymer_ArraySelectorMixin.prototype.toggle;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 error(s), 410 warning(s), 71.8% typed
0 error(s), 331 warning(s), 72.6% typed
3 changes: 3 additions & 0 deletions lib/mixins/gesture-event-listeners.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

'use strict';

/**
* @const {Polymer.Gestures}
*/
const gestures = Polymer.Gestures;

/**
Expand Down
Loading

0 comments on commit 346e2d5

Please sign in to comment.