Created
November 25, 2011 20:59
-
-
Save rsbohn/1394401 to your computer and use it in GitHub Desktop.
leaky abstraction
This file contains 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
ruleset a421x98 { | |
meta { | |
name "Leaky Abstraction" | |
description << | |
>> | |
author "Randall Bohn" | |
logging off | |
} | |
dispatch { | |
// domain "exampley.com" | |
} | |
global { | |
css << #leak { background: #FFC; } | |
>>; | |
leaky = defaction(msg) { | |
rrr = "<div id='leak'>Leaky: #{msg}</div>"; | |
append("#main", rrr) | |
}; | |
} | |
rule first_rule { | |
select when pageview ".*" setting () | |
pre { | |
intro = << <div>You should see one yellow line below, from the 'leaky' defaction. | |
If you see two yellow lines it means that the defaction leaked, clobbering the 'content' variable. | |
</div> >>; | |
rrr = "<div id='obliterated'>Local: Don't tread on me!</div>"; | |
} | |
{ | |
append("#main", intro); | |
leaky("Did I step on something?"); | |
append("#main", rrr) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment