chore: Convert == to === and != to !== where possible. (#5599)

This commit is contained in:
Neil Fraser
2021-10-15 09:17:04 -07:00
committed by GitHub
parent 7ac1e27cd6
commit c929b3015b
183 changed files with 1409 additions and 1409 deletions

View File

@@ -59,7 +59,7 @@ BlocklyStorage.link = function(opt_workspace) {
var xml = Blockly.Xml.workspaceToDom(workspace, true);
// Remove x/y coordinates from XML if there's only one block stack.
// There's no reason to store this, removing it helps with anonymity.
if (workspace.getTopBlocks(false).length == 1 && xml.querySelector) {
if (workspace.getTopBlocks(false).length === 1 && xml.querySelector) {
var block = xml.querySelector('block');
if (block) {
block.removeAttribute('x');
@@ -116,17 +116,17 @@ BlocklyStorage.makeRequest_ = function(url, name, content, workspace) {
* @private
*/
BlocklyStorage.handleRequest_ = function() {
if (BlocklyStorage.httpRequest_.readyState == 4) {
if (BlocklyStorage.httpRequest_.status != 200) {
if (BlocklyStorage.httpRequest_.readyState === 4) {
if (BlocklyStorage.httpRequest_.status !== 200) {
BlocklyStorage.alert(BlocklyStorage.HTTPREQUEST_ERROR + '\n' +
'httpRequest_.status: ' + BlocklyStorage.httpRequest_.status);
} else {
var data = BlocklyStorage.httpRequest_.responseText.trim();
if (BlocklyStorage.httpRequest_.name == 'xml') {
if (BlocklyStorage.httpRequest_.name === 'xml') {
window.location.hash = data;
BlocklyStorage.alert(BlocklyStorage.LINK_ALERT.replace('%1',
window.location.href));
} else if (BlocklyStorage.httpRequest_.name == 'key') {
} else if (BlocklyStorage.httpRequest_.name === 'key') {
if (!data.length) {
BlocklyStorage.alert(BlocklyStorage.HASH_ERROR.replace('%1',
window.location.hash));
@@ -153,7 +153,7 @@ BlocklyStorage.monitorChanges_ = function(workspace) {
function change() {
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
var xmlText = Blockly.Xml.domToText(xmlDom);
if (startXmlText != xmlText) {
if (startXmlText !== xmlText) {
window.location.hash = '';
workspace.removeChangeListener(change);
}