This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 506acb13b61719cda32c836183636d91175f9b5f
tree 9472dfdb5773f5c21b134d3672fe0272e01cb086
parent 7d112623709e10cf16c35650c7d51d32404cf3b7
tree 9472dfdb5773f5c21b134d3672fe0272e01cb086
parent 7d112623709e10cf16c35650c7d51d32404cf3b7
mop-js /
| name | age | message | |
|---|---|---|---|
| |
.gitmodules | Sun Apr 13 04:25:26 -0700 2008 | [osteele] |
| |
CHANGES | Fri Apr 18 21:07:36 -0700 2008 | [osteele] |
| |
MIT-LICENSE | Fri Apr 04 15:25:44 -0700 2008 | [osteele] |
| |
README | Fri Apr 04 16:01:14 -0700 2008 | [osteele] |
| |
examples/ | Fri Apr 18 21:07:36 -0700 2008 | [osteele] |
| |
jsspec &rarr f5758f9 | Sun Apr 13 04:25:26 -0700 2008 | [osteele] |
| |
lib/ | Fri Apr 18 21:07:36 -0700 2008 | [osteele] |
| |
specs/ | Fri Apr 18 21:07:36 -0700 2008 | [osteele] |
README
== JavaScript MOP Utilities
Defines some utilities for JavaScript metaprogramming:
MOP.delegate(target, propertyName, methods)
For each name in `methods`, defines a method on `target` with this
name, that delegates to the method of the `propertyName` property
of `target` with the same name.
And these for asynchronous metaprogramming:
new MOP.MethodReplacer(object, methods)
When a new MethodReplacer is constructed, it replaces each method
on `object` by the method in `methods` with the same key value, if
such a method exists. A MethodReplacer has a single method,
`restore`, which restores each method to its pre-replacement
value.
new MOP.QueueBall(object, methodNames)
When a new QueueBall is constructed, it replaces each method named
by `methodNames` with a method that enqueues the method call (the
name of the method and its arguments). A QueueBall has a single
method, `replayMethodCalls`, which plays back the method calls and
restores the methods.
MOP.withMethodOverridesCallback(object, methods, fn)
Calls `fn` on `object`, within a dynamic scope within which the
methods in `methods` have temporarily replaced the like-named
methods on `object`. The scope is terminated by the argument to
the call to `fn`; this argument should be treated as a
continuation, and restores the methods.
MOP.withDeferredMethods(object, methodNames, fn)
Calls `fn` on `object`, within a dynamic scope within which the
methods in `methodNames` have been enqueued. The scope is
terminated by the argument to the call to `fn`; this argument
should be treated as a continuation, and ends the queue, replaying
the methods.
See the specs for examples.
== License
Copyright 2007-2008 by Oliver Steele. Available under the MIT License.




