Imported from blockly-core