moving isString into plt.baselib.strings
This commit is contained in:
parent
e5312af2cd
commit
190b805b6c
|
@ -9,11 +9,11 @@
|
|||
var equals = function(x, y, aUnionFind) {
|
||||
if (x === y) { return true; }
|
||||
|
||||
if (isNumber(x) && isNumber(y)) {
|
||||
if (jsnums.isSchemeNumber(x) && jsnums.isSchemeNumber(y)) {
|
||||
return jsnums.eqv(x, y);
|
||||
}
|
||||
|
||||
if (isString(x) && isString(y)) {
|
||||
if (baselib.strings.isString(x) && baselib.strings.isString(y)) {
|
||||
return x.toString() === y.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,16 @@
|
|||
baselib.strings = exports;
|
||||
|
||||
|
||||
|
||||
var isString = function(s) {
|
||||
return (typeof s === 'string' ||
|
||||
s instanceof Str);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Now using mutable strings
|
||||
var Str = function(chars) {
|
||||
this.chars = chars;
|
||||
|
@ -156,5 +166,7 @@ String.prototype.toDisplayedString = function(cache) {
|
|||
|
||||
exports.Str = Str;
|
||||
exports.escapeString = escapeString;
|
||||
exports.isString = isString;
|
||||
|
||||
|
||||
})(this['plt'].baselib);
|
|
@ -664,9 +664,8 @@ if (! this['plt']) { this['plt'] = {}; }
|
|||
|
||||
|
||||
|
||||
var isString = function(s) {
|
||||
return (typeof s === 'string' || s instanceof plt.baselib.strings.Str);
|
||||
}
|
||||
var isString = plt.baselib.strings.isString;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user