Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
obj = new Proxy({},
|
||||
{ get : function(target, prop)
|
||||
{
|
||||
if(target[prop] === undefined)
|
||||
return function() {
|
||||
console.log('an otherwise undefined function!!');
|
||||
};
|
||||
else
|
||||
return target[prop];
|
||||
}
|
||||
});
|
||||
obj.f() ///'an otherwise undefined function!!'
|
||||
obj.l = function() {console.log(45);};
|
||||
obj.l(); ///45
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
var example = new Object;
|
||||
example.foo = function () {
|
||||
alert("this is foo");
|
||||
}
|
||||
example.bar = function () {
|
||||
alert("this is bar");
|
||||
}
|
||||
example.__noSuchMethod__ = function (id, args) {
|
||||
alert("tried to handle unknown method " + id);
|
||||
if (args.length != 0)
|
||||
alert("it had arguments: " + args);
|
||||
}
|
||||
|
||||
example.foo(); // alerts "this is foo"
|
||||
example.bar(); // alerts "this is bar"
|
||||
example.grill(); // alerts "tried to handle unknown method grill"
|
||||
example.ding("dong"); // alerts "tried to handle unknown method ding"
|
||||
// alerts "it had arguments: dong
|
||||
Loading…
Add table
Add a link
Reference in a new issue