On 28 March 2011 16:48, Olov Lassus <[email protected]> wrote:
> On Mar 28, 12:56 pm, Nick Morgan <[email protected]> wrote:
> You'll then run this together with restrict-mode.js, which is a
> prelude implementing functions such as __lt:
> function __lt(x, y) {
> var xtype = typeof x;
> var ytype = typeof y;
>
> if (xtype === ytype) {
> if ((xtype === "string" || xtype === "number")) {
> return /*@loose*/(x < y);
> }
> }
> __throw_typeerror("<", x, y);
> }
>
Ok, that makes sense. I can imagine this being a useful tool,
especially on large codebases with a lot of developers. Though it
feels a lot like the whole static typing thing - "it catches all kinds
of errors", but the kinds of errors that wouldn't be made with good
tests and code reviews. I dunno.
--
Nick Morgan
http://skilldrick.co.uk
@skilldrick
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]