Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -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

View file

@ -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