mirror of
https://github.com/google/blockly.git
synced 2026-01-11 02:47:09 +01:00
@@ -358,7 +358,7 @@ Blockly.Lua['lists_split'] = function(block) {
|
||||
}
|
||||
functionName = 'table.concat';
|
||||
} else {
|
||||
throw 'Unknown mode: ' + mode;
|
||||
throw Error('Unknown mode: ' + mode);
|
||||
}
|
||||
var code = functionName + '(' + input + ', ' + delimiter + ')';
|
||||
return [code, Blockly.Lua.ORDER_HIGH];
|
||||
|
||||
@@ -162,5 +162,5 @@ Blockly.Lua['controls_flow_statements'] = function(block) {
|
||||
case 'CONTINUE':
|
||||
return Blockly.Lua.CONTINUE_STATEMENT;
|
||||
}
|
||||
throw 'Unknown flow statement.';
|
||||
throw Error('Unknown flow statement.');
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ Blockly.Lua['math_single'] = function(block) {
|
||||
code = 'math.deg(math.atan(' + arg + '))';
|
||||
break;
|
||||
default:
|
||||
throw 'Unknown math operator: ' + operator;
|
||||
throw Error('Unknown math operator: ' + operator);
|
||||
}
|
||||
return [code, Blockly.Lua.ORDER_HIGH];
|
||||
};
|
||||
@@ -383,7 +383,7 @@ Blockly.Lua['math_on_list'] = function(block) {
|
||||
break;
|
||||
|
||||
default:
|
||||
throw 'Unknown operator: ' + func;
|
||||
throw Error('Unknown operator: ' + func);
|
||||
}
|
||||
return [functionName + '(' + list + ')', Blockly.Lua.ORDER_HIGH];
|
||||
};
|
||||
|
||||
@@ -149,7 +149,7 @@ Blockly.Lua['text_charAt'] = function(block) {
|
||||
} else if (where == 'FROM_END') {
|
||||
var start = '-' + at;
|
||||
} else {
|
||||
throw 'Unhandled option (text_charAt).';
|
||||
throw Error('Unhandled option (text_charAt).');
|
||||
}
|
||||
}
|
||||
if (start.match(/^-?\w*$/)) {
|
||||
@@ -185,7 +185,7 @@ Blockly.Lua['text_getSubstring'] = function(block) {
|
||||
} else if (where1 == 'FROM_END') {
|
||||
var start = '-' + at1;
|
||||
} else {
|
||||
throw 'Unhandled option (text_getSubstring)';
|
||||
throw Error('Unhandled option (text_getSubstring)');
|
||||
}
|
||||
|
||||
// Get end index.
|
||||
@@ -200,7 +200,7 @@ Blockly.Lua['text_getSubstring'] = function(block) {
|
||||
} else if (where2 == 'FROM_END') {
|
||||
var end = '-' + at2;
|
||||
} else {
|
||||
throw 'Unhandled option (text_getSubstring)';
|
||||
throw Error('Unhandled option (text_getSubstring)');
|
||||
}
|
||||
var code = 'string.sub(' + text + ', ' + start + ', ' + end + ')';
|
||||
return [code, Blockly.Lua.ORDER_HIGH];
|
||||
|
||||
Reference in New Issue
Block a user