Merge pull request #631 from jorix/format_undefined
Avoid breaking the "OpenLayers.String.format" execution
This commit is contained in:
@@ -127,7 +127,9 @@ OpenLayers.String = {
|
|||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
replacement = context;
|
replacement = context;
|
||||||
}
|
}
|
||||||
|
if (replacement === undefined) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
replacement = replacement[subs[i]];
|
replacement = replacement[subs[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,8 +155,8 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
t.eq(
|
t.eq(
|
||||||
format("${a.b.c} ${a.b.e} ${a.b.q} ${a} ${a...b...c}", context),
|
format("${a.b.c} ${a.b.e} ${a.b.q} ${a} ${a...b...c} ${aa.b} ${a.bb.c}", context),
|
||||||
"d f undefined [object Object] d",
|
"d f undefined [object Object] d undefined undefined",
|
||||||
"attribute values that are objects are supported"
|
"attribute values that are objects are supported"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user