Simon Willison’s Weblog

Subscribe
Atom feed for pete-michaux

4 items tagged “pete-michaux”

2008

Module Pattern Provides No Privacy... at least not in JavaScript(TM) (via) JavaScript variables hidden inside a closure aren’t as hidden as I thought—it turns out you can pass a closure as the second argument to eval (at least in Firefox) and “steal” private variables back out of it.

# 27th June 2008, 7:01 pm / closures, javascript, firefox, modulepattern, pete-michaux

Transitioning from Java Classes to JavaScript Prototypes. Peter Michaux shows how JavaScript’s prototypal inheritance can run rings around traditional Java-style classes once you figure out how to take advantage of it.

# 10th February 2008, 3:10 pm / javascript, prototypalinheritance, java, classes, inheritance, pete-michaux

2007

Lazy Function Definition Pattern. Neat JavaScript trick: redefine a function the first time it’s called, for example to switch in different browser implementations based on object detection.

# 15th August 2007, 6:57 pm / javascript, pete-michaux

JavaScript Minifier that doesn’t break code (via) Perl re-implementation of Douglas Crockford’s classic JSMin that doesn’t clobber IE’s conditional comments, by Peter Michaux.

# 4th June 2007, 5:44 pm / douglas-crockford, jsmin, james-bennett, internet-explorer, ie, conditionalcomments, perl, pete-michaux, javascript