Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use CONST_CASE for constants. #5564

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/mixins/dir-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const DIR_INSTANCES = [];
/** @type {?MutationObserver} */
let observer = null;

let DOCUMENT_DIR = '';
let documentDir = '';

function getRTL() {
DOCUMENT_DIR = document.documentElement.getAttribute('dir');
documentDir = document.documentElement.getAttribute('dir');
}

/**
Expand All @@ -43,13 +43,13 @@ function getRTL() {
function setRTL(instance) {
if (!instance.__autoDirOptOut) {
const el = /** @type {!HTMLElement} */(instance);
el.setAttribute('dir', DOCUMENT_DIR);
el.setAttribute('dir', documentDir);
}
}

function updateDirection() {
getRTL();
DOCUMENT_DIR = document.documentElement.getAttribute('dir');
documentDir = document.documentElement.getAttribute('dir');
for (let i = 0; i < DIR_INSTANCES.length; i++) {
setRTL(DIR_INSTANCES[i]);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ function isMouseEvent(name) {

/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
// check for passive event listeners
let SUPPORTS_PASSIVE = false;
let supportsPassive = false;
(function() {
try {
let opts = Object.defineProperty({}, 'passive', {get() {SUPPORTS_PASSIVE = true;}});
let opts = Object.defineProperty({}, 'passive', {get() {supportsPassive = true;}});
window.addEventListener('test', null, opts);
window.removeEventListener('test', null, opts);
} catch(e) {}
Expand All @@ -83,7 +83,7 @@ function PASSIVE_TOUCH(eventName) {
if (isMouseEvent(eventName) || eventName === 'touchend') {
return;
}
if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && passiveTouchGestures) {
if (HAS_NATIVE_TA && supportsPassive && passiveTouchGestures) {
return {passive: true};
} else {
return;
Expand Down Expand Up @@ -334,7 +334,7 @@ function untrackDocument(stateObj) {
if (cancelSyntheticClickEvents) {
// use a document-wide touchend listener to start the ghost-click prevention mechanism
// Use passive event listeners, if supported, to not affect scrolling performance
document.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false);
document.addEventListener('touchend', ignoreMouse, supportsPassive ? {passive: true} : false);
}

/**
Expand Down