mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Remove goog.string
This commit is contained in:
@@ -525,7 +525,7 @@ Blockly.utils.tokenizeInterpolation_ = function(message,
|
||||
// BKY_ is the prefix used to namespace the strings used in Blockly
|
||||
// core files and the predefined blocks in ../blocks/. These strings
|
||||
// are defined in ../msgs/ files.
|
||||
var bklyKey = goog.string.startsWith(keyUpper, 'BKY_') ?
|
||||
var bklyKey = Blockly.utils.startsWith(keyUpper, 'BKY_') ?
|
||||
keyUpper.substring(4) : null;
|
||||
if (bklyKey && bklyKey in Blockly.Msg) {
|
||||
var rawValue = Blockly.Msg[bklyKey];
|
||||
@@ -901,3 +901,14 @@ Blockly.utils.getViewportBBox = function() {
|
||||
left: scrollOffset.x
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Fast prefix-checker.
|
||||
* Copied from Closure's goog.string.startsWith.
|
||||
* @param {string} str The string to check.
|
||||
* @param {string} prefix A string to look for at the start of `str`.
|
||||
* @return {boolean} True if `str` begins with `prefix`.
|
||||
*/
|
||||
Blockly.utils.startsWith = function(str, prefix) {
|
||||
return str.lastIndexOf(prefix, 0) == 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user