I've been dabbling in Synchronet JS lately and noticed that the methods
that Syncro provides seem to be a subset of those in the standard.
For example, there is no trim() method.
My immediate question is - how do I trim whitespace from a string like trim() does?
Is there a separate string handling object or something?
It appears you're running Synchronet v3.15b, which uses an older version of the Mozilla-JavaScript engine (SpiderMonkey). Upgrade to v3.16a (The currently development build) and you'll get a much newer JavaScript engine as well.
Re: String functions?
By: Digital Man to Sampsa on Wed Jan 28 2015 17:20:08
It appears you're running Synchronet v3.15b, which uses an older version of the Mozilla-JavaScript engine (SpiderMonkey). Upgrade to v3.16a (The currently development build) and you'll get a much newer JavaScript engine as well.
Ah, yes, I was going to ask about this. Now that I'm delving into file IO; the File object is the one that was proposed for SpiderMonkey that I've googled, no?
I've been dabbling in Synchronet JS lately and noticed that the methods that Syncro provides seem to be a subset of those in the standard.
For example, there is no trim() method.
My immediate question is - how do I trim whitespace from a string like trim( does?
Is there a separate string handling object or something?
LaRRy LaGoMoRpH wrote to Sampsa <=-
I could have possibly typed that wrong. Giving you the answer cause
you owned up to your boner in the other forum(s?). If that doesn't
work check the page, cause it should but I may have typed the regex
wrong.
I've been dabbling in Synchronet JS lately and noticed that the methods
that Syncro provides seem to be a subset of those in the standard.
For example, there is no trim() method.
My immediate question is - how do I trim whitespace from a string like trim() does?
Is there a separate string handling object or something?
Ah, yes, I was going to ask about this. Now that I'm delving into file IO; the File object is the one that was proposed for SpiderMonkey that I've googled, no?
Synchronet's File IO uses it's own interface, it doesn't really follow the proposed file interface, or commonjs, or node's... If you really want to
do file manipulation from JS, you may be better off doing those parts with node.js or io.js ... There are some much richer libraries out there for this, but they won't necessarily run under Synchronet.
Tracker1 wrote to Sampsa <=-
@VIA: VERT
@MSGID: <54D7FE51.1802.sync-js@vert.synchro.net>
@REPLY: <54C8FA4E.1725.sync_js@b4bbs.com>
@TZ: 41e0
I've been dabbling in Synchronet JS lately and noticed that the methods
that Syncro provides seem to be a subset of those in the standard.
For example, there is no trim() method.
My immediate question is - how do I trim whitespace from a string like trim() does?
Is there a separate string handling object or something?
String.prototype.trim = String.prototype.trim || function() {
return this.replace(/^\s+|\s+$/,'');
};
I'm not sure which version of Spidermonkey Synchronet now uses, but
it's been in there for several years now.. it was added to JS as part
of ECMAScript 5. You can probably snag the ES5 SHIMS, and load that at
the top of a common include in your login/logon script.
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 01:10:56 |
Calls: | 369 |
Files: | 2 |
Messages: | 38,903 |