mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
chore: Convert == to === and != to !== where possible. (#5599)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user