This commit is contained in:
duzc2dtw@gmail.com
2017-12-09 20:41:43 +08:00
parent 0ce3963648
commit 26ea42c264

View File

@@ -74,6 +74,9 @@ Blockly.Extensions.register = function(name, initFn) {
* registered.
*/
Blockly.Extensions.registerMixin = function(name, mixinObj) {
if(!goog.isObject(mixinObj)){
throw new Error('Error: Mixin "' + name + '" must be a object');
}
Blockly.Extensions.register(name, function() {
this.mixin(mixinObj);
});