mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
Error is a constructor, ‘new’ is not required.
This commit is contained in:
@@ -767,7 +767,7 @@ FactoryUtils.getBlockTypeFromJsDefinition = function(blockDef) {
|
||||
if (indexOfStartBracket != -1 && indexOfEndBracket != -1) {
|
||||
return blockDef.substring(indexOfStartBracket + 2, indexOfEndBracket);
|
||||
} else {
|
||||
throw new Error ('Could not parse block type out of JavaScript block ' +
|
||||
throw Error('Could not parse block type out of JavaScript block ' +
|
||||
'definition. Brackets normally enclosing block type not found.');
|
||||
}
|
||||
};
|
||||
@@ -921,7 +921,7 @@ FactoryUtils.sameBlockXml = function(blockXml1, blockXml2) {
|
||||
// Each XML element should contain a single child element with a 'block' tag
|
||||
if (blockXml1.tagName.toLowerCase() != 'xml' ||
|
||||
blockXml2.tagName.toLowerCase() != 'xml') {
|
||||
throw new Error('Expected two XML elements, received elements with tag ' +
|
||||
throw Error('Expected two XML elements, received elements with tag ' +
|
||||
'names: ' + blockXml1.tagName + ' and ' + blockXml2.tagName + '.');
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ FactoryUtils.sameBlockXml = function(blockXml1, blockXml2) {
|
||||
var blockElement2 = blockXml2.getElementsByTagName('block')[0];
|
||||
|
||||
if (!(blockElement1 && blockElement2)) {
|
||||
throw new Error('Could not get find block element in XML.');
|
||||
throw Error('Could not get find block element in XML.');
|
||||
}
|
||||
|
||||
var cleanBlockXml1 = FactoryUtils.cleanXml(blockElement1);
|
||||
|
||||
Reference in New Issue
Block a user