Created
February 9, 2010 00:47
-
-
Save smparkes/298789 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
called = undefined; | |
__defineGetter__("foo",function(){return"bar";}); | |
__defineSetter__("bar",function(bif){called = bif;}); | |
try{ | |
if(foo!=="bar"){ | |
print("should equal bar"); | |
} | |
} catch(e) { | |
print("should not have raised "+e); | |
} | |
bar = 0xdeadbeef; | |
if(called!==0xdeadbeef){ | |
print("should have been called with the right value"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment