http://trac.tiddlywiki.org/changeset/12289
MartinBudden
2010-07-21 07:21:57 -0700 (Wed, 21 Jul 2010)
81
Ticket #1237
String.prototype.format should accept arbitrary number of arguments
---------------
U Trunk/core/js/Strings.js
---------------
Modified: Trunk/core/js/Strings.js
===================================================================
--- Trunk/core/js/Strings.js 2010-07-21 09:48:00 UTC (rev 12288)
+++ Trunk/core/js/Strings.js 2010-07-21 14:21:57 UTC (rev 12289)
@@ -22,8 +22,9 @@
};
// Substitute substrings from an array into a format string that includes
'%1'-type specifiers
-String.prototype.format = function(substrings)
+String.prototype.format = function(s)
{
+ var substrings = s && s.constructor == Array ? s : arguments;
var subRegExp = /(?:%(\d+))/mg;
var currPos = 0;
var r = [];
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywikidev?hl=en.