Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove dom-tracer (own lib now), fix Map/Set missing in firefox

  • Loading branch information...
commit 0c66361e990176a1393daca37d03035599fe2d64 1 parent fbca97d
@Benvie authored
View
2  browser/build.js
@@ -30,7 +30,7 @@ var libs = names.map(function(name){
});
var output = [
- '"meta-objects" in window || (window["meta-objects"] = function(exports, global){',
+ '"meta" in window || (window.meta = function(exports, global){',
'"use strict";',
'function require(s){ s = s.replace(/^[./]*/, ""); return typeof exports[s] === "function" ? exports : exports[s]; }',
libs.join('\n\n'),
View
508 examples/dom-tracer/README.md
@@ -1,508 +0,0 @@
-# DOM Tracer
-
-Loads jQuery (unmodified) onto a membrane DOM and logs what it does.
-
-__Example jQuery startup Output__
-
-```javascript
-get | getElementsByTagName.% length
-get | @document createElement ["^document"]
-apply | @document.createElement ["select"]
-get | createElement.% appendChild ["select"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["option"]
-apply | createElement.%.appendChild [option]
-get | createElement.% getElementsByTagName ["div"]
-apply | createElement.%.getElementsByTagName ["input"]
-get | getElementsByTagName.% 0
-get | createElement.% firstChild ["div"]
-get | createElement.%.firstChild nodeType ["div", "^text(3)"]
-get | createElement.% getElementsByTagName ["div"]
-apply | createElement.%.getElementsByTagName ["tbody"]
-get | getElementsByTagName.% length
-get | createElement.% getElementsByTagName ["div"]
-apply | createElement.%.getElementsByTagName ["link"]
-get | getElementsByTagName.% length
-get | getElementsByTagName.%.0 getAttribute ["div", "a"]
-apply | getElementsByTagName.%.0.getAttribute ["style"]
-get | getElementsByTagName.%.0 getAttribute ["div", "a"]
-apply | getElementsByTagName.%.0.getAttribute ["href"]
-get | getElementsByTagName.%.0 style ["div", "a"]
-get | getElementsByTagName.%.0.styleopacity
-get | getElementsByTagName.%.0 style ["div", "a"]
-get | getElementsByTagName.%.0.stylecssFloat
-get | getElementsByTagName.%.0 value ["div", "input"]
-get | createElement.% selected ["select", "option"]
-get | createElement.% className ["div"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["form"]
-get | createElement.% enctype ["form"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["nav"]
-get | createElement.% cloneNode ["nav"]
-apply | createElement.%.cloneNode [true]
-get | cloneNode.% outerHTML ["nav"]
-get | @documentcompatMode ["^document"]
-set | getElementsByTagName.%.0 checked ["div", "input"]
-get | getElementsByTagName.%.0 cloneNode ["div", "input"]
-apply | getElementsByTagName.%.0.cloneNode [true]
-get | cloneNode.% checked ["input"]
-set | createElement.% disabled ["select"]
-get | createElement.% disabled ["select", "option"]
-delete | createElement.% test ["div"]
-get | createElement.% addEventListener ["div"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["input"]
-set | createElement.% value ["input"]
-get | createElement.% setAttribute ["input"]
-apply | createElement.%.setAttribute ["type", "radio"]
-get | createElement.% value ["input"]
-get | createElement.% setAttribute ["input"]
-apply | createElement.%.setAttribute ["checked", "checked"]
-get | createElement.% setAttribute ["input"]
-apply | createElement.%.setAttribute ["name", "t"]
-get | createElement.% appendChild ["div"]
-apply | createElement.%.appendChild [input t]
-get | @document createDocumentFragment ["^document"]
-apply | @document.createDocumentFragment []
-get | createDocumentFragment.% appendChild ["^fragment"]
-get | createElement.% lastChild ["div"]
-apply | createDocumentFragment.%.appendChild [input t]
-get | createDocumentFragment.% cloneNode ["^fragment"]
-apply | createDocumentFragment.%.cloneNode [true]
-get | cloneNode.% cloneNode ["^fragment"]
-apply | createDocumentFragment.%.cloneNode [true]
-get | cloneNode.% lastChild ["^fragment"]
-get | cloneNode.%.lastChildchecked ["^fragment", "input"]
-get | createElement.% checked ["^fragment", "input"]
-get | createDocumentFragment.% removeChild ["^fragment"]
-apply | createDocumentFragment.%.removeChild [input t]
-get | createDocumentFragment.% appendChild ["^fragment"]
-apply | createDocumentFragment.%.appendChild [div]
-get | createElement.% attachEvent ["^fragment", "div"]
-get | createDocumentFragment.% removeChild ["^fragment"]
-apply | createDocumentFragment.%.removeChild [div]
-get | toString call
-apply | call ["anonymous"]
-get | @document readyState ["^document"]
-get | @document addEventListener ["^document"]
-get | @document addEventListener ["^document"]
-apply | @document.addEventListener ["DOMContentLoaded", "anonymous", false]
-get | @addEventListener
-apply | @.addEventListener ["load", "anonymous", false]
-get | toString call
-apply | call ["anonymous"]
-get | @Math random
-apply | @Math.random []
-get | toString call
-apply | call [["radio", "checkbox"]]
-get | @document removeEventListener ["^document"]
-get | toString call
-apply | call [["blur", "focus", "focusin", 22 more...]]
-get | @Math random
-apply | @Math.random []
-get | @Object prototype
-get | @Object.prototype toString
-construct | @.RegExp ["#((?: [\w\u00c0-\uFFFF\-...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^0 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?)#((?: [\...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp ["\.((?: [\w\u00c0-\uFFFF\...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^2 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?)\.((?:[...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp ["\ [name= ['"]*((?: [\w\u00...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^4 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?)\ [name=...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp ["\ [\s*((?: [\w\u00c0-\uFF...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^6 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?)\ [\s*((...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp ["^((?: [\w\u00c0-\uFFFF\*...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^8 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?)^((?: [\...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp [":(only|nth|last|first)-...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^10 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?):(only|...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp [":(nth|eq|gt|lt|first|la...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^12 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?):(nth|e...?! [^\ []*\])(?! [^\(]*\))"]
-construct | @.RegExp [":((?: [\w\u00c0-\uFFFF\-...?! [^\ []*\])(?! [^\(]*\))"]
-get | @.RegExp.^14 source
-construct | @.RegExp ["(^(?:.|\r|\n)*?):((?: [\...?! [^\ []*\])(?! [^\(]*\))"]
-get | @Array prototype
-get | @Array.prototype slice
-get | slicecall
-get | @document document Element ["^document"]
-get | @document.document Element childNodes ["^document", "html"]
-apply | call [[head, <TextNode textContent="\n ">, body], 0]
-get | call.% 0
-get | call.%.0nodeType ["^document", "html", "head"]
-get | @document documentElement ["^document"]
-get | @document.documentElement compareDocumentPosition ["^document", "html"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-construct | @Date []
-get | @Date.^0getTime
-apply | getTime []
-get | @document documentElement ["^document"]
-set | createElement.% innerHTML ["div"]
-get | @document.documentElement insertBefore ["^document", "html"]
-get | @document.documentElement firstChild ["^document", "html"]
-apply | @document.documentElement.insertBefore [div, head]
-get | @document getElementById ["^document"]
-apply | @document.getElementById ["script1337186829145"]
-get | @document.documentElementremoveChild ["^document", "html"]
-apply | @document.documentElement.removeChild [div]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-get | createElement.% appendChild ["div"]
-get | @documentcreateComment ["^document"]
-apply | @document.createComment [""]
-apply | createElement.%.appendChild [Comment { length=0, nodeName="#comment", nodeType=8, more...}]
-get | createElement.% getElementsByTagName ["div"]
-apply | createElement.%.getElementsByTagName ["*"]
-get | getElementsByTagName.% length
-set | createElement.% innerHTML ["div"]
-get | createElement.% firstChild ["div"]
-get | createElement.% firstChild ["div"]
-get | createElement.%.firstChildgetAttribute ["div", "a"]
-get | createElement.% firstChild ["div"]
-get | createElement.%.firstChildgetAttribute ["div", "a"]
-apply | getElementsByTagName.%.0.getAttribute ["href"]
-get | @document querySelectorAll ["^document"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-set | createElement.% innerHTML ["div"]
-get | createElement.% querySelectorAll ["div"]
-get | createElement.% querySelectorAll ["div"]
-apply | createElement.%.querySelectorAll [".TEST"]
-get | querySelectorAll.% length
-get | @document documentElement ["^document"]
-get | @document.documentElement matchesSelector ["^document", "html"]
-get | @document.documentElement mozMatchesSelector ["^document", "html"]
-get | @document.documentElement.mozMatchesSelector call
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-apply | call [div, "div"]
-get | @document.documentElement.mozMatchesSelector call
-get | @document documentElement ["^document"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-set | createElement.% innerHTML ["div"]
-get | createElement.% getElementsByClassName ["div"]
-get | createElement.% getElementsByClassName ["div"]
-apply | createElement.%.getElementsByClassName ["e"]
-get | getElementsByClassName.% length
-get | createElement.% lastChild ["div"]
-set | createElement.%.lastChild className ["div", "div.e"]
-get | createElement.% getElementsByClassName ["div"]
-apply | createElement.%.getElementsByClassName ["e"]
-get | getElementsByClassName.% length
-get | @document documentElement ["^document"]
-get | @document.documentElementcontains ["^document", "html"]
-get | @Array prototype
-get | @Array.prototype slice
-construct | @.RegExp ["<(?:abbr|article|aside|...mmary|time|video) [\s/>]", "i"]
-get | @document createDocumentFragment ["^document"]
-apply | @document.createDocumentFragment []
-get | createDocumentFragment.% createElement ["^fragment"]
-get | @document defaultView ["^document"]
-get | @document defaultView ["^document"]
-get | @getComputedStyle
-get | @document documentElement ["^document"]
-get | @document.documentElementcurrentStyle ["^document", "html"]
-get | toString call
-apply | call [["height", "width"]]
-get | toString call
-apply | call ["anonymous"]
-get | toString call
-apply | call ["anonymous"]
-get | @locationhref
-get | toString call
-apply | call [["ajaxStart", "ajaxStop", "ajaxComplete", 3 more...]]
-get | toString call
-apply | call [["get", "post"]]
-get | @String
-construct | @Date []
-get | @Date.^1getTime
-apply | getTime []
-get | toString call
-apply | call ["callback"]
-apply | @Array.isArray ["callback"]
-get | toString call
-apply | call ["anonymous"]
-apply | @Array.isArray ["anonymous"]
-get | toString call
-apply | call ["anonymous"]
-get | toString call
-apply | call [Object { script="text/javascript, applic...pplication/x-ecmascript"}]
-get | hasOwnProperty call
-apply | call [Object { script="text/javascript, applic...pplication/x-ecmascript"}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { script="text/javascript, applic...pplication/x-ecmascript"}, "script"]
-get | toString call
-apply | call [Object { xml="application/xml, text/xml", html="text/html", text="text/plain", more...}]
-get | hasOwnProperty call
-apply | call [Object { xml="application/xml, text/xml", html="text/html", text="text/plain", more...}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { xml="application/xml, text/xml", html="text/html", text="text/plain", more...}, "*"]
-get | toString call
-apply | call ["text/javascript, applic...pplication/x-ecmascript"]
-apply | @Array.isArray ["text/javascript, applic...pplication/x-ecmascript"]
-get | toString call
-apply | call [Object { script=RegExp}]
-get | hasOwnProperty call
-apply | call [Object { script=RegExp}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { script=RegExp}, "script"]
-get | toString call
-apply | call [Object { xml=RegExp, html=RegExp, json=RegExp, more...}]
-get | hasOwnProperty call
-apply | call [Object { xml=RegExp, html=RegExp, json=RegExp, more...}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { xml=RegExp, html=RegExp, json=RegExp, more...}, "json"]
-get | toString call
-apply | call [RegExp /javascript|ecmascript/]
-apply | @Array.isArray [RegExp /javascript|ecmascript/]
-get | toString call
-apply | call [Object { text script=function()}]
-get | hasOwnProperty call
-apply | call [Object { text script=function()}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { text script=function()}, "text script"]
-get | toString call
-apply | call [Object { text html=true, * text=String(), text json=function(), more...}]
-get | hasOwnProperty call
-apply | call [Object { text html=true, * text=String(), text json=function(), more...}, "constructor"]
-get | hasOwnProperty call
-apply | call [Object {}, "isPrototypeOf"]
-get | hasOwnProperty call
-apply | call [Object { text html=true, * text=String(), text json=function(), more...}, "text xml"]
-get | toString call
-apply | call ["anonymous"]
-apply | @Array.isArray ["anonymous"]
-get | toString call
-apply | call ["anonymous"]
-get | toString call
-apply | call ["anonymous"]
-get | @ActiveXObject
-get | @ActiveXObject
-get | @XMLHttpRequest
-construct | @.XMLHttpRequest []
-has | @.XMLHttpRequest.^0 withCredentials
-get | toString call
-apply | call ["anonymous"]
-get | toString call
-apply | call [["height", "marginTop", "marginBottom", 2 more...]]
-get | toString call
-apply | call [["height", "marginTop", "marginBottom", 2 more...]]
-get | toString call
-apply | call [["height", "marginTop", "marginBottom", 2 more...]]
-get | toString call
-apply | call ["anonymous"]
-get | toString call
-apply | call [["height", "marginTop", "marginBottom", 8 more...]]
-get | @document documentElement ["^document"]
-has | @document.documentElementgetBoundingClientRect ["^document", "html"]
-set | @$
-set | @jQuery
-get | @document removeEventListener ["^document"]
-apply | @document.removeEventListener ["DOMContentLoaded", "anonymous", false]
-get | @document body ["^document"]
-get | @document getElementsByTagName ["^document"]
-apply | @document.getElementsByTagName ["body"]
-get | getElementsByTagName.% 0
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-get | createElement.% style ["div"]
-set | createElement.%.stylecssText
-get | @document.bodyinsertBefore ["^document", "html", "body"]
-get | @document.bodyfirstChild ["^document", "html", "body"]
-apply | @document.body.insertBefore [div, <TextNode textContent="\n ">]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-get | createElement.% appendChild ["^document", "html", "body", "div"]
-apply | createElement.%.appendChild [div]
-set | createElement.% innerHTML ["^document", "html", "body", "div", "div"]
-get | createElement.% getElementsByTagName ["^document", "html", "body", "div", "div"]
-apply | createElement.%.getElementsByTagName ["td"]
-get | getElementsByTagName.% 0
-get | getElementsByTagName.%.0 offsetHeight ["^document", "html", "body", "div", "div", "table", "tbody", "tr", "td"]
-get | getElementsByTagName.% 0
-get | getElementsByTagName.%.0 style ["^document", "html", "body", "div", "div", "table", "tbody", "tr", "td"]
-set | getElementsByTagName.%.0.styledisplay
-get | getElementsByTagName.% 1
-get | getElementsByTagName.%.1 style ["^document", "html", "body", "div", "div", "table", "tbody", "tr", "td"]
-set | getElementsByTagName.%.1.styledisplay
-get | getElementsByTagName.% 0
-get | getElementsByTagName.%.0offsetHeight ["^document", "html", "body", "div", "div", "table", "tbody", "tr", "td"]
-get | @getComputedStyle
-set | createElement.% innerHTML ["^document", "html", "body", "div", "div"]
-get | @document createElement ["^document"]
-apply | @document.createElement ["div"]
-get | createElement.% style ["div"]
-set | createElement.%.stylewidth
-get | createElement.% style ["div"]
-set | createElement.%.stylemarginRight
-get | createElement.% style ["^document", "html", "body", "div", "div"]
-set | createElement.%.stylewidth
-get | createElement.% appendChild ["^document", "html", "body", "div", "div"]
-apply | createElement.%.appendChild [div]
-get | @getComputedStyle
-apply | @.getComputedStyle [div, null]
-get | getComputedStyle.% marginRight
-apply | @parseInt ["0px", 10]
-get | createElement.% style ["^document", "html", "body", "div", "div"]
-get | createElement.%.stylezoom
-get | createElement.% style ["^document", "html", "body", "div", "div"]
-set | createElement.%.style cssText
-set | createElement.% innerHTML ["^document", "html", "body", "div", "div"]
-get | createElement.% firstChild ["^document", "html", "body", "div", "div"]
-get | createElement.%.firstChildfirstChild ["^document", "html", "body", "div", "div", "div"]
-get | createElement.%.firstChild nextSibling ["^document", "html", "body", "div", "div", "div"]
-get | createElement.%.firstChild.nextSibling firstChild ["^document", "html", "body", "div", "div", "table"]
-get | createElement.%.firstChild.nextSibling.firstChildfirstChild ["^document", "html", "body", "div", "div", "table", "tbody"]
-get | createElement.%.firstChild.firstChild offsetTop ["^document", "html", "body", "div", "div", "div", "div"]
-get | createElement.%.firstChild.nextSibling.firstChild.firstChildoffsetTop ["^document", "html", "body", "div", "div", "table", "tbody", "tr"]
-get | createElement.%.firstChild.firstChild style ["^document", "html", "body", "div", "div", "div", "div"]
-set | createElement.%.firstChild.firstChild.styleposition
-get | createElement.%.firstChild.firstChild style ["^document", "html", "body", "div", "div", "div", "div"]
-set | createElement.%.firstChild.firstChild.styletop
-get | createElement.%.firstChild.firstChild offsetTop ["^document", "html", "body", "div", "div", "div", "div"]
-get | createElement.%.firstChild.firstChild style ["^document", "html", "body", "div", "div", "div", "div"]
-get | createElement.%.firstChild.firstChild style ["^document", "html", "body", "div", "div", "div", "div"]
-set | createElement.%.firstChild.firstChild.styletop
-set | createElement.%.firstChild.firstChild.styleposition
-get | createElement.%.firstChild style ["^document", "html", "body", "div", "div", "div"]
-set | createElement.%.firstChild.style overflow
-get | createElement.%.firstChild style ["^document", "html", "body", "div", "div", "div"]
-set | createElement.%.firstChild.style position
-get | createElement.%.firstChild.firstChild offsetTop ["^document", "html", "body", "div", "div", "div", "div"]
-get | @document.body offsetTop ["^document", "html", "body"]
-get | @getComputedStyle
-get | createElement.% style ["^document", "html", "body", "div", "div"]
-set | createElement.%.stylemarginTop
-get | @getComputedStyle
-apply | @.getComputedStyle [div, null]
-get | getComputedStyle.% marginTop
-get | createElement.% style ["^document", "html", "body", "div"]
-get | createElement.%.stylezoom
-get | @document.bodyremoveChild ["^document", "html", "body"]
-apply | @document.body.removeChild [div]
-get | @document nodeType ["^document"]
-get | toString call
-apply | call [[HTMLDocument {}]]
-get | @document nodeType ["^document"]
-get | @document nodeType ["^document"]
-construct | @Date []
-get | @Date.^2getTime
-apply | getTime []
-get | @document window ["^document"]
-get | @document parentNode ["^document"]
-get | @document nodeName ["^document"]
-get | @document nodeName ["^document"]
-get | @document nodeType ["^document"]
-get | @document jQuery17209023800967826752 ["^document"]
-get | @document onready ["^document"]
-get | @document nodeName ["^document"]
-get | @document nodeName ["^document"]
-get | @documentready ["^document"]
-get | toString call
-apply | call [[HTMLDocument {}]]
-get | @document nodeType ["^document"]
-get | @document jQuery17209023800967826752 ["^document"]
-get | @String constructor
-get | @String constructor
-get | @Function name
-proto | @String __proto__
-get | @String toString
-apply | toString []
-get | @String length
-get | @String length
-get | @Stringcallee
-get | @String constructor
-get | @String constructor
-get | @Function name
-get | @String name
-get | @String name
-get | @String constructor
-get | @String constructor
-get | @Function name
-proto | @String __proto__
-get | @String toString
-apply | toString []
-get | @String length
-get | @String length
-get | @String callee
-get | @String constructor
-get | @String constructor
-get | @Function name
-get | @String name
-get | @String name
-get | @String constructor
-get | @String constructor
-get | @Function name
-proto | @String __proto__
-get | @String toString
-apply | toString []
-get | @String length
-get | @String length
-get | @Stringcallee
-get | @String constructor
-get | @String constructor
-get | @Function name
-get | @String name
-get | @String name
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument toString
-get | @document constructor ["^document"]
-get | @.HTMLDocument toString
-apply | @.HTMLDocument .toString []
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument name
-proto | @document__proto__ ["^document"]
-get | @document toString ["^document"]
-apply | @document.toString []
-get | @document length ["^document"]
-get | @document length ["^document"]
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument name
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @document toString ["^document"]
-get | @document toString ["^document"]
-apply | @document.toString []
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument toString
-get | @document constructor ["^document"]
-get | @.HTMLDocument toString
-apply | @.HTMLDocument .toString []
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument name
-proto | @document__proto__ ["^document"]
-get | @document toString ["^document"]
-apply | @document.toString []
-get | @document length ["^document"]
-get | @document length ["^document"]
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @.HTMLDocument name
-get | @document constructor ["^document"]
-get | @document constructor ["^document"]
-get | @document toString ["^document"]
-get | @document toString ["^document"]
-apply | @document.toString []
-```
View
400 examples/dom-tracer/dom-tracer.js
@@ -1,400 +0,0 @@
-!function(global, exports, require){
-"use strict";
-
-/***/
-var meta = require('meta-objects');
-var extend = meta.utility.Object.extend;
-var isObject = meta.utility.Object.isObject;
-var apply = meta.utility.Function.apply;
-var applybind = meta.utility.Function.applybind;
-var flatten = meta.utility.Array.flatten;
-var Emitter = meta.Emitter;
-
-var devDefaults = {
- file: 'jquery-1.7.2.js',
- socket: 'localhost:5555'
-};
-
-
-
-if (typeof window !== 'undefined') {
- var extendEventTarget = function(){
- function resolveEvents(events){
- if (typeof events === 'string')
- return events.split(' ');
- else if (Array.isArray(events))
- return events;
- else
- return [];
- }
-
- function on(events, listener){
- resolveEvents(events).forEach(function(event){
- this.addEventListener(event, listener);
- }, this);
- }
-
- function off(events, listener){
- resolveEvents(events).forEach(function(event){
- this.removeEventListener(event, listener);
- }, this);
- }
-
- function once(events, listener){
- function one(){
- offAll();
- listener.apply(this, arguments);
- }
- var offAll = off.bind(this, events, one);
- this.on(events, one);
- }
-
- var loggers = new WeakMap;
-
- function log(events){
- if (loggers.has(this)) {
- var logger = loggers.get(this);
- this.off(logger.events, logger);
- } else {
- var logger = function logger(evt){
- console.log(evt.type, evt);
- }
- loggers.set(this, logger);
- }
- logger.events = resolveEvents(events);
- this.on(logger.events, logger);
- }
-
- return function extendEventTarget(Ctor){
- extend(Ctor.prototype, [on, off, once, log]);
- }
- }();
-
- extendEventTarget(WebSocket);
-}
-
-
-
-
-
-// ###################
-// ### TraceLoader ###
-// ###################
-
-function TraceLoader(filename){
- Emitter.call(this);
- var self = this;
- this.state = 'loading';
- this.loader = new XHR('', function(src){
- self.code = src;
- self.state = 'downloaded';
- self.emit('download', src);
- }).exec(filename);
-}
-
-extend(TraceLoader, {
- TRAPS: [ 'UNKNOWN', 'GET', 'SET', 'DESCRIBE', 'DEFINE', 'DELETE', 'HAS',
- 'OWNS', 'ENUMERATE', 'KEYS', 'NAMES', 'FIX', 'APPLY', 'CONSTRUCT' ],
- natives: new WeakMap
-});
-
-var T = TraceLoader.TRAPS;
-
-
-T.forEach(function(trap, index){
- T[trap] = index;
-});
-
-[ Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError,
- Array, Boolean, Date, /*Function,*/ Map, Number, Object, Proxy, RegExp, Set, String, WeakMap,
- decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, escape, /*eval,*/
- isFinite, isNaN, parseFloat, parseInt, unescape, Math, JSON
-].forEach(function(item){
- TraceLoader.natives.set(item, true);
-});
-
-
-TraceLoader.prototype = extend(new Emitter, [
- function compile(){
- var self = this;
- var globalKeys = Object.getOwnPropertyNames(global).filter(function(key){
- return /^[\w_$]*$/.test(key)
- && isObject(global[key])
- && !TraceLoader.natives.has(global[key]);
- });
-
- var tracer = meta.tracer(global);
- var interceptors = globalKeys.map(function(key){
- return tracer.root[key];
- });
-
- var root = tracer.root;
- delete tracer.root;
-
- this.code = '\n'+this.code+'\n';
- var compiled = Function.apply(null, globalKeys.concat(this.code));
- this.state = 'compiled';
- this.run = function run(){
- compiled.apply(root, interceptors);
- self.state = 'executed';
- };
-
- return this.emitter = tracer;
- }
-]);
-
-
-
-// ##############
-// ### Record ###
-// ##############
-
-function Record(time, trap, id, name, result, args){
- this.time = time;
- this.trap = trap;
- this.id = id;
- if (name)
- this.name = name;
- if (result)
- this.result = result;
- if (args)
- this.args = args;
-}
-
-extend(Record.prototype, [
- function serialize(){
- return JSON.stringify(this);
- }
-]);
-
-extend(Record, [
- function deserialize(json){
- var record = Object.create(Record.prototype);
- json = JSON.parse(json);
-
- Object.keys(json).forEach(function(key){
- record[key] = json[key];
- });
-
- record.trap = TraceLoader.TRAPS[record.trap];
- return record;
- },
-]);
-
-
-
-// ########################
-// ### EventDestination ###
-// ########################
-
-function EventDestination(socketServer){
- var self = this;
- this.map = Object.create(null);
- this.names = [];
- this.resolve(10000, global);
- this.socket = new WebSocket('ws://'+(socketServer|| devDefaults.socket));
- this.socket.log('error close open');
- this.socket.on('open', function(evt){
- self.socket.send('destination');
- self.socket.on('message', function(evt){
- var record = Record.deserialize(evt.data);
- record.name = self.resolveName(record.name);
- record.result = self[record.trap](record);
- });
- });
-}
-
-extend(EventDestination.prototype, [
- function resolveName(name){
- if (typeof name === 'number')
- return this.names[name];
- this.names.push(name);
- return name;
- },
- function resolveGet(record){
- if (record.id in this.map)
- return this.map[record.id][record.name];
- else
- console.log('id not found', record);
- },
- function resolve(id, o){
- if (typeof id !== 'number' || id < 10000)
- return id;
- if (!(id in this.map) && o !== undefined)
- this.map[id] = o;
- return this.map[id];
- },
- function OWNS(record){ },
- function ENUMERATE(record){ },
- function KEYS(record){ },
- function NAMES(record){ },
- function FIX(record){ },
- function DESCRIBE(record){
- var target = this.resolve(record.id);
- if (isObject(target))
- return this.resolve(record.id, Object.getOwnPropertyDescriptor(target, record.name));
- },
- function DEFINE(record){
- },
- function HAS(record){
- },
- function GET(record){
- return this.resolve(record.result, this.resolveGet(record));
- },
- function SET(record){
- var target = this.resolve(record.id)
- if (target)
- target[record.name] = this.resolve(record.result);
- },
- function DELETE(record){
- delete this.resolve(record.id)[record.name];
- },
- function APPLY(record){
- var fn = this.resolveGet(record);
- if (typeof fn === 'function') {
- var args = record.args.map(function(arg){
- return arg >= 10000 ? this.resolve(arg) : arg;
- }, this);
- return this.resolve(record.result, fn.apply(this.resolve(record.id), args));
- }
- },
- function CONSTRUCT(record){
- var fn = this.resolve(record.id);
- var result;
- var args = record.args.map(function(arg){
- return typeof arg === 'number' && arg >= 10000 ? this.resolve(arg) : arg;
- });
- if (typeof fn === 'function' && isFinite(record.result)) {
- switch (record.args.length) {
- case 0: result = new fn; break;
- case 1: result = new fn(args[0]); break;
- case 2: result = new fn(args[0], args[1]); break;
- case 3: result = new fn(args[0], args[1], args[2]); break;
- case 4: result = new fn(args[0], args[1], args[2], args[3]); break;
- default: result = new (applybind(fn, flatten(null, args)));
- }
- return this.resolve(record.result, result);
- }
- }
-]);
-
-
-// ###################
-// ### EventOrigin ###
-// ###################
-
-function EventOrigin(socketServer, interceptFile){
- var self = this;
- this.history = [];
- this.map = new WeakMap;
- this.map.index = 10000;
- this.names = Object.create(null);
- this.names.___count = 0;
- this.resolve(global);
- this.socket = new WebSocket('ws://'+(socketServer|| devDefaults.socket));
- this.socket.log('error close open');
- this.socket.on('open', function(evt){
- self.socket.send('origin');
- // self.socket.on('message', function(evt){
- // var data = evt.data;
- // if (data === 'history')
- // self.history.forEach(function(item){
- // self.socket.send(item);
- // });
- // });
- var tracer = self.tracer = new TraceLoader(interceptFile || devDefaults.file);
- tracer.on('download', function(){
- var emitter = tracer.compile();
- T.forEach(function(trap){
- if (typeof self[trap] === 'function') {
- emitter.on(trap.toLowerCase(), self[trap].bind(self));
- }
- });
- self.startTime = Date.now();
- tracer.run();
- });
- });
-}
-
-// [ T.UNKNOWN, T.GET, T.SET, T.DEFINE, T.DELETE, T.HAS, T.OWNS,
-// T.ENUMERATE, T.KEYS, T.NAMES, T.FIX, T.APPLY, T.CONSTRUCT ]
-
-var functionNames = new WeakMap;
-
-extend(EventOrigin.prototype, [
- function resolveName(name){
- if (name in this.names)
- return this.names[name];
-
- this.names[name] = this.names.___count++;
- return name;
- },
- function resolve(o){
- if (!isObject(o))
- return o;
- if (this.map.has(o))
- return this.map.get(o);
-
- this.map.set(o, this.map.index++);
- return this.map.index - 1;
- },
- function broadcast(trap, target, name, result, args){
- target = this.resolve(target);
- result = this.resolve(result)
- if (args)
- args = args.map(this.resolve.bind(this));
-
- var record = new Record(this.elapsed(), trap, target, this.resolveName(name), result, args);
- this.history.push(record);
- var json = record.serialize();
- this.socket.send(json);
- },
- function elapsed(){
- return Date.now() - this.startTime;
- },
- function GET(e){
- if (typeof e.result === 'function')
- functionNames.set(e.result, e.property);
- this.broadcast(T.GET, e.target, e.property, e.result);
- },
- function SET(e){
- this.broadcast(T.SET, e.target, e.property, e.value);
- },
- function DELETE(e){
- this.broadcast(T.DELETE, e.target, e.property);
- },
- function FIX(e){
- this.broadcast(T.FIX, e.target);
- },
- function DESCRIBE(e){
- this.broadcast(T.DESCRIBE, e.target, e.property, e.result);
- },
- function DEFINE(e){
- this.broadcast(T.DEFINE, e.target, e.property, e.value);
- },
- function APPLY(e){
- this.broadcast(T.APPLY, e.context, functionNames.get(e.target) || e.target.name, e.result, e.args);
- },
- function CONSTRUCT(e){
- this.broadcast(T.CONSTRUCT, e.target, e.name, e.result, e.args);
- },
-]);
-
-exports.createOrigin = function createOrigin(socketServer, jsToLoad){
- return new EventOrigin(socketServer, jsToLoad);
-};
-
-exports.createDestination = function createDestination(socketServer){
- return new EventDestination(socketServer);
-};
-
-
-/***/
-}(typeof window !== 'undefined' ? window : this, typeof exports !== 'undefined'
- ? exports
- : this,
- typeof require !== 'undefined'
- ? require
- : function(s,r){
- return r = function require(n){ return s[n] }
- }(this));
View
12 examples/dom-tracer/index.html
@@ -1,12 +0,0 @@
-<!doctype HTML>
-<html>
- <meta charset="utf-8">
- <head>
- <title>DOM Tracer</title>
- </head>
- <body>
- <script src="../../meta-objects.browser.js"></script>
- <script src="xhr.js"></script>
- <script src="dom-tracer.js"></script>
- </body>
-</html>
View
9,404 examples/dom-tracer/jquery-1.7.2.js
0 additions, 9,404 deletions not shown
View
10 examples/dom-tracer/jquery-1.7.2.min.js
0 additions, 10 deletions not shown
View
86 examples/dom-tracer/ws-server.js
@@ -1,86 +0,0 @@
-var util = require('util');
-
-var TRAPS = [ 'UNKNOWN', 'GET', 'SET', 'DESCRIBE', 'DEFINE', 'DELETE', 'HAS',
- 'OWNS', 'ENUMERATE', 'KEYS', 'NAMES', 'FIX', 'APPLY', 'CONSTRUCT' ];
-
-TRAPS.forEach(function(trap, index){
- TRAPS[trap] = index;
-});
-
-
-function logJSON(json){
- try {
- json = JSON.parse(json);
- if (isFinite(json.trap))
- json.trap = TRAPS[json.trap];
- } catch (e) { }
- console.log(util.inspect(json, false, 4, true));
-}
-
-
-function ClientCollection(echoevents){
- this.clients = [];
- this.echoevents = [].concat.apply([], arguments);
-}
-
-ClientCollection.prototype = new process.EventEmitter;
-ClientCollection.prototype.constructor = ClientCollection;
-
-
-ClientCollection.prototype.add = function add(client){
- var self = this;
- this.clients.push(client);
- this.echoevents.forEach(function(event){
- client.on(event, function(){
- self.emit.apply(this, arguments);
- });
- });
- this.emit('newclient', client);
-}
-
-ClientCollection.prototype.send = function send(a, b){
- this.clients.forEach(function(client){
- client.send(a, b);
- });
-}
-
-
-var sources = new ClientCollection(['message']);
-var destinations = new ClientCollection(['message']);
-
-var WebSocketServer = require('ws').Server,
- server = new WebSocketServer({ port: 5555 });
-
-
-sources.on('message', function(message){
- destinations.send(message);
-});
-
-destinations.on('message', function(message){
- sources.send(message);
-});
-
-server.on('connection', function(client){
- console.log('connection');
- var others;
- client.once('message', function(info){
- logJSON(info)
- if (info === 'origin') {
- sources.add(client);
- others = destinations;
- } else if (info === 'destination'){
- destinations.add(client);
- others = sources;
- }
- client.on('message', function(a, b){
- others.send(a, b)
- })
- });
-
- client.on('error', logJSON)
- client.on('close', logJSON)
-});
-
-
-
-
View
169 examples/dom-tracer/xhr.js
@@ -1,169 +0,0 @@
-var XHR = function(){
- function Transport(options, callback){
- options = options || {};
- if (typeof options === 'string')
- options = { url: options };
- if (typeof callback === 'function')
- options.callback = callback;
- this.data = options.data || {};
- this.base = options.url;
- this.path = options.path || [];
- if (options.callback)
- this.callback = options.callback;
- this.state = 'idle';
- }
-
- !function(){
- var transports = {}
-
- Transport.register = function register(ctor){
- transports[ctor.name.toLowerCase()] = ctor;
- }
-
- Transport.lookup = function lookup(name){
- name = name.toLowerCase();
- return name in transports ? transports[name] : null;
- }
- Transport.create = function create(type, base, dispatcher){
- var T = Transport.lookup(type);
- return new T(base, dispatcher);
- }
- }();
-
- Transport.prototype = {
- constructor: Transport,
-
- get params(){
- var data = Object.keys(this.data).map(function(name){ return [name, this.data[name]] }, this);
- data.push([this.callbackParam, this.callbackName]);
- return data.map(function(item){
- return encodeURIComponent(item[0]) + "=" + encodeURIComponent(item[1]);
- }).join('&');
- },
- }
-
-
- var types = {
- json: 'text',
- css: 'text',
- jpg: 'blob',
- png: 'blob',
- txt: 'text',
- js: 'text',
- html: 'document',
- svg: 'document',
- xml: 'document',
- '': 'text'
- };
-
-
- function XHR(options, callback){
- this.sync = false;
- Transport.call(this, options = options || {}, callback);
- this.headers = {};
- if (options.headers) {
- Object.keys(options.headers).forEach(function(n){
- this.headers[n] = options.headers[n];
- }, this);
- }
- this.callback = callback;
- }
-
- Transport.register(XHR);
-
- var pathmap = {};
- var verbs = {
- get: true,
- post: true,
- put: true,
- delete: true,
- options: true
- }
-
- XHR.prototype = {
- __proto__: Transport.prototype,
- constructor: XHR,
- verb: 'get',
- get url(){
- var base = this.base ? [this.base] : [];
- return base.concat(this.path).join('/') + (this.verb === 'get' && this.params ? '?' + this.params : '');
- },
- get ext(){
- if (this.path in pathmap)
- return pathmap[this.path];
- else {
- var offset = this.path.lastIndexOf('.');
- return pathmap[this.path] = ~offset ? this.path.slice(offset + 1) : '';
- }
- },
- auth: function auth(user, pass){
- if (!pass && user.length === 40) {
- this.headers.Authorization = 'token '+user;
- } else {
- this.headers.Authorization = 'Basic '+btoa(user+':'+pass);
- }
- },
- exec: function exec(request){
- var xhr = new XMLHttpRequest;
- var self = this;
- var completed;
- if (request) {
- if (request.toLowerCase() in verbs) {
- var verb = request;
- request = arguments[1];
- }
- if (typeof request === 'string')
- this.path = request;
- }
-
-
- function complete(){
- if (xhr.readyState === 4) {
- self.state = 'complete';
- if (xhr.sync)
- xhr.responseType = types[xhr.ext];
-
- var result = xhr.response
- if (xhr.ext === 'json')
- result = JSON.parse(result);
-
- if (self.callback)
- self.callback.call(self, result);
-
- return result;
- }
- }
-
- xhr.ext = this.ext;
- if (xhr.ext === 'js' || xhr.ext === 'json')
- xhr.overrideMimeType('text/plain');
-
- xhr.onerror = complete;
- xhr.onload = complete;
-
- xhr.open(verb || 'GET', this.url, !this.sync);
-
- if (this.sync)
- xhr.responseType = types[xhr.ext];
-
- if (this.headers.Authenticate)
- xhr.withCredentials = true;
-
- Object.keys(this.headers).forEach(function(name){
- xhr.setRequestHeader(name, self.headers[name]);
- });
-
-
- if (this.sync) {
- xhr.send(this.data || null);
- return complete();
- }
-
- xhr.send(this.data || null);
- this.state = 'loading';
- return this;
- }
- };
-
- return XHR;
-}();
View
19 lib/utility.js
@@ -34,7 +34,7 @@ var FP = Function.prototype,
names = getPropertyNames,
namesOwn = Object.getOwnPropertyNames;
-var types = [ Array, Boolean, Date, Function, Map, Number, Object, RegExp, Set, String, WeakMap ];
+var types = [ Array, Boolean, Date, Function, Number, Object, RegExp, String ];
function Descriptor(type, valueOrGet, readonlyOrSet, hidden, frozen){
@@ -214,6 +214,12 @@ function unique(a){
}
function setHidden(o,n,v){
+ if (isObject(n)) {
+ for (var k in n)
+ if (hasOwn(n, k))
+ define(o, k, hiddenValue(n[k]));
+ return this;
+ }
return define(o, n, hiddenValue(v));
}
@@ -379,13 +385,20 @@ function O(o){
wrapped.set(this, Object(o));
}
+var def = function define(o,n,v){
+ if (isObject(n))
+ Object.defineProperties(o,n);
+ else
+ Object.defineProperty(o,n,v);
+ return o;
+}
+
exports.O = extend(O, {
make: make,
brand: brandName,
create: Object.create,
clone: clone,
- define: Object.defineProperty,
- defines: Object.defineProperties,
+ define: def,
describe: getPropertyDescriptor,
describeAll: getPropertyDescriptors,
describeAllOwn: getOwnPropertyDescriptors,
View
27 meta-objects.browser.js
@@ -1,4 +1,4 @@
-"meta-objects" in window || (window["meta-objects"] = function(exports, global){
+"meta" in window || (window.meta = function(exports, global){
"use strict";
function require(s){ s = s.replace(/^[./]*/, ""); return typeof exports[s] === "function" ? exports : exports[s]; }
!function(){
@@ -38,7 +38,7 @@ var FP = Function.prototype,
names = getPropertyNames,
namesOwn = Object.getOwnPropertyNames;
-var types = [ Array, Boolean, Date, Function, Map, Number, Object, RegExp, Set, String, WeakMap ];
+var types = [ Array, Boolean, Date, Function, Number, Object, RegExp, String ];
function Descriptor(type, valueOrGet, readonlyOrSet, hidden, frozen){
@@ -140,7 +140,11 @@ function extend(to, from){
extend(to, arguments[2]);
return to;
}
-
+// function extend(o){
+// var i, k, p, a = arguments;
+// for (i in a) if (i) for (k in (p = a[i])) if ({}.hasOwnProperty.call(p, k)) o[k] = p[k];
+// return o;
+// }
function make(o, p){
return p ? extend(create(o), p) : create(o);
}
@@ -218,6 +222,12 @@ function unique(a){
}
function setHidden(o,n,v){
+ if (isObject(n)) {
+ for (var k in n)
+ if (hasOwn(n, k))
+ define(o, k, hiddenValue(n[k]));
+ return this;
+ }
return define(o, n, hiddenValue(v));
}
@@ -383,13 +393,20 @@ function O(o){
wrapped.set(this, Object(o));
}
+var def = function define(o,n,v){
+ if (isObject(n))
+ Object.defineProperties(o,n);
+ else
+ Object.defineProperty(o,n,v);
+ return o;
+}
+
exports.O = extend(O, {
make: make,
brand: brandName,
create: Object.create,
clone: clone,
- define: Object.defineProperty,
- defines: Object.defineProperties,
+ define: def,
describe: getPropertyDescriptor,
describeAll: getPropertyDescriptors,
describeAllOwn: getOwnPropertyDescriptors,
View
2  meta-objects.browser.min.js
@@ -1 +1 @@
-"meta-objects"in window||(window["meta-objects"]=function(exports,global){"use strict";function require(s){return s=s.replace(/^[./]*/,""),typeof exports[s]=="function"?exports:exports[s]}return!function(){!function(global,exports){"use strict";var FP=Function.prototype,OP=Object.prototype,AP=Array.prototype,RP=RegExp.prototype,DP=Date.prototype,bindbind=FP.bind.bind(FP.bind),callbind=bindbind(FP.call),applybind=bindbind(FP.apply),calling=callbind(FP.call),binding=callbind(FP.bind),applying=callbind(FP.apply),hasOwn=callbind(OP.hasOwnProperty),flatten=applybind(AP.concat),concat=callbind(AP.concat),map=callbind(AP.map),reduce=callbind(AP.reduce),create=Object.create,define=Object.defineProperty,defines=Object.defineProperties,describe=getPropertyDescriptor,describeAll=getPropertyDescriptors,describeAllOwn=getOwnPropertyDescriptors,describeOwn=Object.getOwnPropertyDescriptor,getProto=Object.getPrototypeOf,keys=Object.keys,names=getPropertyNames,namesOwn=Object.getOwnPropertyNames,types=[Array,Boolean,Date,Function,Map,Number,Object,RegExp,Set,String,WeakMap];function Descriptor(type,valueOrGet,readonlyOrSet,hidden,frozen){this[type?"setAccessors":"setValue"](valueOrGet,readonlyOrSet),hidden&&(this.enumerable=!1),frozen&&(this.configurable=!1)}Descriptor.VALUE=0,Descriptor.ACCESSOR=1,Descriptor.prototype={constructor:Descriptor,configurable:!0,enumerable:!0,setValue:function setValue(value,readonly){this.value=value,this.writable=!readonly},setAccessors:function setAccessors(get,set){this.get=get,this.set=set}};function getValue(d){if(d)return d.value}function value(v,h,r,f){return new Descriptor(0,v,r,h,f)}function hiddenValue(v,r,f){return new Descriptor(0,v,r,!0,f)}function accessor(g,s,h,f){return new Descriptor(1,g,s,h,f)}function hiddenAccessor(g,s,f){return new Descriptor(1,g,s,!0,f)}function isAccessor(desc){return isObject(desc)&&("get"in desc||"set"in desc)&&!("value"in desc)}function isValue(desc){return isObject(desc)&&!("get"in desc||"set"in desc)&&"value"in desc}function isBuiltin(o){return types.indexOf(o)>-1}function forEach(o,callback,context,hidden){context===!0?(hidden=!0,context=o):context=context||o,(hidden===!0?namesOwn:keys)(Object(o)).forEach(function(key){callback.call(context,o[key],key,o)})}function extend(to,from){to=Object(to),from=Object(from);if(isBuiltin(to)||keys(to).length===0&&names(to)>0)var desc=hiddenValue();else var desc=value();var fromBuiltin=isBuiltin(from);return!fromBuiltin&&Array.isArray(from)?from.forEach(function(item){typeof item=="function"&&item.name&&(desc.value=item,define(to,item.name.replace(/_$/,""),desc))}):(fromBuiltin?namesOwn:keys)(from).forEach(function(key){if(!hasOwn(to,key)&&!fromBuiltin||typeof from[key]=="function")desc.value=from[key],define(to,key,desc)}),arguments.length>2&&extend(to,arguments[2]),to}function make(o,p){return p?extend(create(o),p):create(o)}function clone(o){return create(getProto(o),describeAllOwn(o))}function isObject(o){return o!==null&&typeof o=="object"||typeof o=="function"}function isPrimitive(o){return o==null||typeof o!="object"&&typeof o!="function"}function setPrototypeOf(o,v){if(isObject(o)&&isObject(v)||v===null)o.__proto__=v;return v}function getPropertyDescriptor(o,n){while(isObject(o)){var desc=describeOwn(o,n);if(desc)return desc;o=getProto(o)}return undefined}function getPropertyNames(o){var out=[];while(isObject(o))out.push(namesOwn(o)),o=getProto(o);return unique(flatten([],out))}function getOwnPropertyDescriptors(o){var out={};return namesOwn(o).forEach(function(key){out[key]=describeOwn(o,key)}),out}function getPropertyDescriptors(o){var out={};return names(o).forEach(function(key){out[key]=describe(o,key)}),out}function allKeys(o){var out=[];while(isObject(o))out.push(keys(o)),o=getProto(o);return unique(flatten([],out))}function parameters(fn){return(fn+="").slice(fn.indexOf("(")+1,fn.indexOf(")")).split(/\s*,\s*/)}function unique(a){return keys(reduce(a,function(r,s){return r[s]=1,r},{}))}function setHidden(o,n,v){return define(o,n,hiddenValue(v))}var slice=function(_slice){return function slice(a,o,p){switch(a.length){case 0:return[];case 1:return o?[]:[a[0]];default:return _slice.call(a,o,p);case 2:a=[a[0],a[1]]}return o||p?a.slice(o,p):a}}(AP.slice),monkeypatch=function(){var toString={configurable:!0,writable:!0,value:Function('return function toString(){ return "'+(Object+"").replace(/\n/g,"\\n").replace("Object",'"+this.name+"')+'" }')()};return define(toString.value,"toString",toString),function monkeypatch(o,v){return setHidden(o,v.name,v),typeof v=="function"&&v.toString!==toString.value&&define(v,"toString",toString),v}}();function stringify(o){var stringifier=stringify[brandName(o)]||stringify.Object;return stringifier(o)}var brandName=function(){var brands={};return types.forEach(function(Ctor){hasOwn(Ctor.prototype,"toString")&&(stringify[Ctor.name]=callbind(Ctor.prototype.toString)),brands["[object "+Ctor.name+"]"]=Ctor.name}),function brandName(o){var brand=stringify.Object(o);return brand in brands?brands[brand]:brand}}();exports.Descriptor=extend(Descriptor,{accessor:accessor,getValue:getValue,hiddenAccessor:hiddenAccessor,hiddenValue:hiddenValue,isAccessor:isAccessor,isValue:isValue,value:value}),exports.Object=extend(function Object(o){return o?global.Object(o):Object.create(null)},{allKeys:allKeys,brandName:brandName,extend:extend,forEach:forEach,getOwnPropertyDescriptors:getOwnPropertyDescriptors,getPropertyDescriptor:getPropertyDescriptor,getPropertyDescriptors:getPropertyDescriptors,getPropertyNames:getPropertyNames,hasOwn:hasOwn,isObject:isObject,isPrimitive:isPrimitive,monkeypatch:monkeypatch,setHidden:setHidden,setPrototypeOf:setPrototypeOf,stringify:stringify.Object},Object),exports.Function=extend({applybind:applybind,applying:applying,bindbind:bindbind,binding:binding,callbind:callbind,calling:calling,parameters:parameters,stringify:stringify.Function},Function),exports.Array=extend(function Array(n){return global.Array.apply(null,global.Array(n))},{flatten:flatten,slice:slice,stringify:stringify.Array,unique:unique},global.Array),namesOwn(AP).forEach(function(key){!exports.Array[key]&&typeof AP[key]=="function"&&(exports.Array[key]=callbind(AP[key]))});var wrappedNative=new WeakMap;exports.RegExp=function RegExp(s,t){if(!(this instanceof RegExp))return new RegExp(s,t);wrappedNative.set(this,new global.RegExp(s,t))},extend(exports.RegExp,{exec:callbind(RP.exec),execable:bindbind(RP.exec),stringify:stringify.RegExp,test:callbind(RP.test),testable:bindbind(RP.test)}),extend(exports.RegExp.prototype,{toString:function toString(){return exports.RegExp.stringify(wrappedNative.get(this))},valueOf:function valueOf(){return wrappedNative.get(this)},test:function test(s){return exports.RegExp.test(wrappedNative.get(this),s)},testable:function testable(){return exports.RegExp.testable(wrappedNative.get(this))},exec:function exec(s){return exports.RegExp.exec(wrappedNative.get(this),s)},execable:function execable(){return exports.RegExp.execable(wrappedNative.get(this))},split:function split(s){return s.split(wrappedNative.get(this))},match:function match(s){return s.match(wrappedNative.get(this))},replace:function replace(s,r){return s.replace(wrappedNative.get(this),r)}}),exports.Date=extend(function Date(p){return new(applybind(global.Date,flatten(null,p)))},{stringify:stringify.Date});var wrapped=new WeakMap;function O(o){if(!(this instanceof O))return new O(o);wrapped.set(this,Object(o))}exports.O=extend(O,{make:make,brand:brandName,create:Object.create,clone:clone,define:Object.defineProperty,defines:Object.defineProperties,describe:getPropertyDescriptor,describeAll:getPropertyDescriptors,describeAllOwn:getOwnPropertyDescriptors,describeOwn:Object.getOwnPropertyDescriptor,each:forEach,extend:extend,getProto:Object.getPrototypeOf,has:hasOwn,isObj:isObject,keys:Object.keys,allKeys:allKeys,names:getPropertyNames,namesOwn:Object.getOwnPropertyNames,notObj:isPrimitive,setHidden:setHidden,setProto:setPrototypeOf,stringify:stringify}),O.prototype.unwrap=function(){return wrapped.get(this)},forEach(O,function(fn,key){typeof fn=="function"&&(O.prototype[key]=function(){return fn.apply(null,flatten(wrapped.get(this),arguments))})})}(Function("return this")(),typeof window!="undefined"?exports.utility={}:typeof exports=="undefined"?this:exports)}(),!function(){var _Object=require("./utility").Object;function lookup(o){if(!wrapmaps.has(o))throw new TypeError("WrapMaps are not generic");return wrapmaps.get(o)}var wrapmaps=new WeakMap;function WrapMap(wrapper){var wrapped=new WeakMap,unwrapped=new WeakMap;if(typeof wrapper=="function")var wrap=function wrap(o,isDescriptor){if(isDescriptor===!0)return wrapDescriptor(o);if(_Object.isPrimitive(o)||wrapped.has(o))return o;if(unwrapped.has(o))return unwrapped.get(o);var p=wrapper(o);return _Object.isObject(p)&&(wrapped.set(p,o),unwrapped.set(o,p)),p};else var wrap=function wrap(o,p){return _Object.isPrimitive(o)||wrapped.has(o)?o:unwrapped.has(o)?unwrapped.get(o):(_Object.isObject(p)&&(wrapped.set(p,o),unwrapped.set(o,p)),p)};function unwrap(o,isDescriptor){return isDescriptor===!0?unwrapDescriptor(o):_Object.isPrimitive(o)||!wrapped.has(o)?o:wrapped.get(o)}function has(o){return Object.isObject(o)&&wrapped.has(o)}function remove(o){var p=unwrap(o);return o!==p&&wrapped.delete(o),p}function wrapDescriptor(o){return _Object.isObject(o)&&!wrapped.has(o)&&(o.value&&(o.value=wrap(o.value)),o.set&&(o.set=wrap(o.set)),o.get&&(o.get=wrap(o.get))),o}function unwrapDescriptor(o){return _Object.isObject(o)&&wrapped.has(o)&&(o.value&&(o.value=unwrap(o.value)),o.set&&(o.set=unwrap(o.set)),o.get&&(o.get=unwrap(o.get))),o}var self=this===global?Object.create(WrapMap.prototype):this;return self.wrap=wrap,self.unwrap=unwrap,self.remove=remove,self.has=has,wrapmaps.set(self,{wrap:wrap,unwrap:unwrap,remove:remove,has:has}),self}WrapMap.prototype={constructor:WrapMap,wrap:function wrap(o,p){return lookup(this).wrap(o,p)},unwrap:function unwrap(o){return lookup(this).unwrap(o)},remove:function remove(o){return lookup(this).remove(o)},has:function has(o){return lookup(this).has(o)}},exports.WrapMap=WrapMap}(),!function(){var _Array=require("./utility").Array;function Event(type,target){this.type=type,this.target=target}function ErrorEvent(error,event,target){Event.call(this,"error",target),this.error=error,this.event=event}var emitters=new WeakMap,receivers=new WeakMap;function _(o){if(!emitters.has(o)){var ret={};return receivers.set(o,o),emitters.set(o,ret),ret}return emitters.get(o)}function Emitter(){emitters.set(this,{}),receivers.set(this,this)}Emitter.Event=Event,Emitter.forward=function forward(from,to){emitters.has(to)||(emitters.set(to,{}),receivers.set(to,to)),emitters.set(from,emitters.get(to)),from.on=Emitter.prototype.on.bind(to),from.off=Emitter.prototype.off.bind(to)},Emitter.prototype={constructor:Emitter,on:function on(events,listener){var listeners=_(this);events.split(" ").forEach(function(event){event in listeners?listeners[event].push(listener):listeners[event]=[listener]})},off:function off(events,listener){var listeners=_(this);events.split(" ").forEach(function(event){listeners[event]&&listeners[event].splice(listeners[event].indexOf(listener),1)})},offAll:function offAll(event){delete _(this)[event]},once:function once(event,listener){var self=this;this.on(event,function(){return self.off(event,listener),listener.apply(receivers.get(self),arguments)})},isListened:function isListened(type){var events=_(this),listeners=events[type]||events["*"];return Boolean(listeners&&listeners.length)},emit:function emit(type){var event,events=_(this);typeof type!="string"&&type.type&&(event=type,type=type.type);if(events["*"])var listeners=events[type]?events["*"].concat(events[type]):events["*"];else var listeners=events[type];if(listeners&&listeners.length){event=event||new Event(type,receivers.get(this));var args=[event].concat(_Array.slice(arguments,1));for(var i=0;i<listeners.length;i++)try{listeners[i].apply(this,args)}catch(e){this.emit(new ErrorEvent(e,event,listeners[i]))}}}},exports.Emitter=Emitter,exports.Event=Event}(),!function(){var utility=require("./utility"),_Function=utility.Function,_Object=utility.Object,_Array=utility.Array,O=utility.O,Descriptor=utility.Descriptor,createProxyObject=Proxy.create,createProxyFunction=Proxy.createFunction,wmhas=_Function.callbind(WeakMap.prototype.has),wmget=_Function.callbind(WeakMap.prototype.get),wmset=_Function.callbind(WeakMap.prototype.set),wmdelete=_Function.callbind(WeakMap.prototype.delete),wmhasget=function hasget(wm,obj){return _Object.isObject(obj)&&(wm=wmget(wm,obj))===undefined?obj:wm},checkArray=function(){var wrapped=new WeakMap,isArr=Array.isArray;return _Object.monkeypatch(Array,function isArray(){var a=arguments[0];return isArr(a)?!0:_Object.isPrimitive(a)?!1:wmhas(wrapped,a)}),function(o,p){isArr(o)&&wmset(wrapped,o,!0)}}(),checkToString=function(){var wrapped=new WeakMap;return[Function,RegExp,Object,Date].forEach(function(Ctor){var stringify=utility[Ctor.name].stringify;function toString(){return stringify(wmhasget(wrapped,this))}wmset(wrapped,toString,Ctor.prototype.toString),_Object.monkeypatch(Ctor.prototype,toString)}),function(o,p){wmset(wrapped,p,o)}}();typeof StopIteration=="undefined"&&(global.StopIteration=O.create(O.create(null)),_Object.monkeypatch(StopIteration.__proto__,function toString(){return"[object StopIteration]"}));function Iterator(next){this.next=next}function definer(o,n,v,newDesc){return o[n]=v,!0}function setter(desc,rcvr,val){var exists=desc.set!=null;return exists&&_Function.calling(desc.set,rcvr,val),exists}function configurable(desc){return desc&&(desc.configurable=!0),desc}var forwarder={getProto:function getProto(T){return O.getProto(T)},setProto:function setProto(T,V){return T.__proto__=V,!0},describe:function describe(T,N){return configurable(O.describeOwn(T,N))},define:function define(T,N,D){return O.define(T,N,D),!0},"delete":function delete_(T,N){return delete T[N]},fix:function fix(T){return Object.freeze(T)},keys:function keys(T){return O.keys(T)},names:function names(T){return O.namesOwn(T)},enumerate:function enumerate(T){return O.allKeys(T)},owns:function owns(T,N){return O.has(T,N)},has:function has(T,N){return N in T},get:function get(T,N,R){var handler=wmget(proxies,T);if(handler!=null)return wmget(handler,R,N);try{var desc=O.describeOwn(T,N)}catch(e){return unwrap(R)[N]}if(desc==null){var proto=O.getProto(T);if(proto!=null)return forwarder.get(proto,N,R)}else{if(Descriptor.isValue(desc))return desc.value;if(Descriptor.isAccessor(desc)&&typeof desc.get=="function")return _Function.calling(desc.get,R)}return undefined},set:function set(T,N,V,R){var handler=wmget(proxies,T);if(handler)return handler.set(R,N,V);try{var oDesc=O.describeOwn(T,N)}catch(e){return unwrap(R)[N]=V,!0}if(oDesc)return Descriptor.isAccessor(oDesc)?setter(oDesc,R,V):oDesc.writable?definer(R,N,V,R!==T):!1;var proto=O.getProto(T);return proto===null?definer(unwrap(R),N,V,!0):forwarder.set(proto,N,V,R)},apply:function apply(T,A,R){return _Function.applying(T,R,A)},construct:function construct(T,A){var handler=wmget(proxies,T);if(handler)return handler.construct(T,A);var result=new(_Function.applying(Function.bind,T,[null].concat(A)));return _Object.isObject(result)?result:O.create(T.prototype)},iterate:function iterate(T){var handler=wmget(proxies,T);if(handler)return handler.iterate(T);var enumerables=O.allKeys(T),index=0;return new Iterator(function(){if(index===enumerables.length)throw StopIteration;return enumerables[index++]})}};function unwrap(o){return wmget(targets,o)||o}var trapMap={getPrototypeOf:"getProto",setPrototypeOf:"setProto",getOwnPropertyDescriptor:"describe",getOwnPropertyNames:"names",defineProperty:"define","delete":"delete",fix:"fix",keys:"keys",enumerate:"enumerate",iterate:"iterate",hasOwn:"owns",has:"has",get:"get",set:"set",apply:"apply",construct:"construct"};_Object.monkeypatch(Object,function getPrototypeOf(o){return wmhas(proxies,o)?wmget(proxies,o).getPrototypeOf():O.getProto(o)});var proxies=new WeakMap,targets=new WeakMap;function proxy(target,handler,callable){if(!_Object.isObject(target))throw new TypeError("Target must be an object");if(!_Object.isObject(handler))throw new TypeError("Handler must be an object");function makeFwd(args,trap){var fwd=function(){return _Function.applying(forwarder[fwd.trap],handler,[fwd.target].concat(fwd.args))};return fwd.target=target,fwd.args=args,fwd.trap=trap,fwd}var metaHandler=createProxyObject({get:function get(R,trap){return trap==="getPropertyDescriptor"?function getPropertyDescriptor(n){return configurable(get(null,"getOwnPropertyDescriptor")(n)||O.describe(get(null,"getPrototypeOf")),n)}:trap==="getPropertyNames"?function getPropertyNames(){return _Array.unique(get(null,"getOwnPropertyNames")().concat(O.names(get(null,"getPrototypeOf"))))}:function metaget(){var args,after;if(arguments[0]==="__proto__"||arguments[1]==="__proto__")switch(trap){case"getOwnPropertyDescriptor":after=Descriptor.hiddenValue;case"get":args=[],trap="getProto";break;case"set":args=[arguments[2]],trap="setProto";break;case"defineProperty":args=[Descriptor.getValue(arguments[1])],trap="setProto"}else if(trap==="get")args=[arguments[1],arguments[0]];else if(trap==="set")args=[arguments[1],arguments[2],arguments[0]];else{if(!trapMap[trap])throw Error('Unknown trap "'+trap+'"');trap=trapMap[trap],args=_Array.slice(arguments)}var trapHandler=handler[trap];if(typeof trapHandler!="function")var ret=_Function.applying(forwarder[trap],handler,[target].concat(args));else var ret=_Function.applying(trapHandler,handler,[makeFwd(args,trap),target].concat(args));return after?after(ret):ret}}});if(callable===!0||callable==null&&typeof target=="function")var reflectProxy=createProxyFunction(metaHandler,function(){return metaHandler.apply(_Array.slice(arguments),this)},function(){return metaHandler.construct(_Array.slice(arguments))});else var reflectProxy=createProxyObject(metaHandler,O.getProto(target));return wmset(proxies,reflectProxy,metaHandler),wmset(targets,reflectProxy,target),checkArray(target,reflectProxy),checkToString(target,reflectProxy),reflectProxy}exports.proxy=proxy}(),!function(){var _Array=require("./utility").Array,_Function=require("./utility").Function,_Object=require("./utility").Object,proxy=require("./proxy").proxy,WrapMap=require("./WrapMap").WrapMap,fakehandler={};function membrane(handlers){if(_Object.isPrimitive(handlers))throw Error("Handlers must be provided");var wrapper=new WrapMap(function(target){return proxy(target,proxy(fakehandler,{get:function membraneHandlerGet(f,t,trap){return function membraneMetaHandler(fwd,faketarget){var handler=handlers[trap],args=_Array.slice(arguments);args[1]=fwd.target=wrapper.unwrap(faketarget);if(handler){var origfwd=fwd;fwd=function fwd(){return _Function.applying(handler,handlers,args)},fwd.args=origfwd.args}return _Function.applying(wrapHandler[trap],null,_Array.concat([fwd],_Array.slice(args,1)))}}}))});function forward(fwd){return fwd()}var wrapHandler={names:forward,enumerate:forward,keys:forward,"delete":forward,owns:forward,has:function has(){return!0},getProto:function getProto(fwd,target){return wrapper.wrap(fwd())},setProto:function setProto(fwd,target,value){return fwd.args[0]=wrapper.unwrap(value),wrapper.wrap(fwd())},fix:function fix(fwd,target){throw target},define:function define(fwd,target,name,desc){return wrapper.unwrap(desc,!0),fwd()},describe:function describe(fwd,target,name){return wrapper.wrap(fwd(),!0)},get:function get(fwd,target,name,rcvr){return fwd.args[1]=wrapper.unwrap(rcvr),wrapper.wrap(fwd())},set:function set(fwd,target,name,val,rcvr){return fwd.args[1]=wrapper.unwrap(val),fwd.args[2]=wrapper.unwrap(rcvr),fwd()},apply:function apply(fwd,target,args,rcvr){return fwd.args[0]=_Array.map(args,wrapper.unwrap),fwd.args[1]=wrapper.unwrap(rcvr),wrapper.wrap(fwd())},construct:function construct(fwd,target,args){return fwd.args[0]=_Array.map(args,wrapper.unwrap),wrapper.wrap(fwd())}};return wrapper}exports.membrane=membrane}(),!function(){var proxy=require("./proxy").proxy,_Array=require("./utility").Array,_Function=require("./utility").Function,O=require("./utility").O;function multiherit(o){o.params=o.params||[];var arglist=o.ctors.map(function(ctor,i){return Array.isArray(o.params[i])?o.params[i]:_Function.parameters(ctor).map(function(param){return o.params.indexOf(param)})}),protos=o.ctors.map(function(ctor){return ctor.prototype});return new MultiCtor(new Multiproto(protos),arglist,o)}function MultiCtor(proto,params,o){var ctors=o.ctors;function Ctor(){var args=arguments;for(var i=0;i<ctors.length;i++)_Function.applying(ctors[i],this,params[i].map(function(i){return args[i]}));return this}return Ctor.prototype=proto,proto.constructor=Ctor,this.name=o.name||ctors.map(function(ctor){return ctor.name}).join(""),this.createInstance=instanceCreator(proto,o.onCall,o.onConstruct),proxy(Ctor,this)}function toString(){return"function "+this.name+"() { [native code] }"}MultiCtor.prototype={get:function(fwd,target,name,rcvr){return name==="name"?this.name:name==="toString"?toString:fwd()},describe:function(fwd,target,name){if(name==="name"){var desc=fwd();return desc.value=this.name,desc}return fwd()},call:function(fwd,target,args,rcvr){return this.construct(fwd,target,args)},construct:function(fwd,target,args){return _Function.applying(target,this.createInstance(),args)}};function instanceCreator(proto,call,construct){if(call||construct){var handler={apply:function(fwd,target,args,rcvr){return _Function.applying(call,rcvr,args)},construct:function(fwd,target,args){return construct?_Function.applying(construct,Object.create(target.prototype),args):_Function.applying(call,global,args)}};return function(){var fake=function(){};return fake.__proto__=proto,proxy(fake,handler)}}return function(){return Object.create(proto)}}function Multiproto(protos){this.protos=protos=Object.freeze(protos.slice());var proto=Object.create(null,{inherits:{configurable:!0,value:protos}});return proxy(proto,this)}Multiproto.prototype=function(){function list(fwd,target){return _Array.unique(this.protos.reduce(function(ret,proto){return fwd.target=proto,ret.concat(fwd())},fwd())).filter(function(s){return!(s in Object.prototype)})}function has(fwd,target,name){if(fwd())return!0;for(var i=0;i<this.protos.length;i++){fwd.target=this.protos[i];if(fwd())return!0}return!1}return{names:list,keys:list,enumerate:list,hasOwn:has,has:has,describe:function(fwd,target,name){var desc=fwd();if(desc)return desc;for(var i=0;i<this.protos.length;i++){fwd.target=this.protos[i],desc=fwd();if(desc)return desc}return undefined},get:function(fwd,target,name,rcvr){var ret,i=0;while(typeof ret=="undefined"&&fwd.target)ret=fwd(),fwd.target=this.protos[i++];return ret}}}(),exports.multiherit=multiherit}(),!function(){var proxy=require("./proxy").proxy,membrane=require("./membrane").membrane,Emitter=require("./Emitter").Emitter;function TraceEmitter(object,name){var self=this instanceof TraceEmitter?this:Object.create(TraceEmitter.prototype);name=name||"root",Emitter.call(this);var wrapper=membrane(proxy({},{get:function get(f,t,trap){return function(fwd,target,prop){var ret=fwd();return self.emit(new TraceEvent(trap,target,fwd.args,ret)),ret}}}));this.unwrap=wrapper.unwrap,this[name]=wrapper.wrap(object)}TraceEmitter.prototype=Object.create(Emitter.prototype),TraceEmitter.prototype.constructor=TraceEmitter;function TraceEvent(type,target,args,result){this.type=type,this.target=target,this.result=result;var i=0;switch(type){case"keys":case"names":case"enumerate":case"fix":case"getProto":break;case"setProto":this.value=args[0];break;case"set":this.result===!0&&delete this.result;case"define":this.value=args[1];case"get":case"describe":this.property=args[0];break;case"apply":this.context=args[1];case"construct":this.name=target.name,this.args=args[0]}}TraceEvent.prototype=Object.create(Emitter.Event.prototype),TraceEvent.prototype.constructor=TraceEvent,exports.tracer=function tracer(object,name){return new TraceEmitter(object,name)},exports.TraceEmitter=TraceEmitter,exports.TraceEvent=TraceEvent}(),!function(){var _Function=require("./utility").Function,_Object=require("./utility").Object,proxy=require("./proxy").proxy;function callable(obj){return proxy(obj,handler,!0)}function list(fwd){return fwd().filter(function(s){return s!=="$$call"&&s!=="$$construct"&&!_Object.hasOwn(s)})}var handler={enumerate:list,keys:list,names:list,apply:function(fwd,target,args,rcvr){var call=target.$$call;return call?_Function.applying(call,target,args):undefined},construct:function(fwd,target,args){var construct=target.$$construct,instance=proxy(Object.create(target),handler,!0);if(construct){var result=_Function.applying(construct,instance,args);return _Object.isObject(result)?result:instance}return instance}};exports.callable=callable}(),!function(){var O=require("./utility").O,proxy=require("./proxy").proxy,WrapMap=require("./WrapMap").WrapMap,Descriptor=require("./utility").Descriptor,store=new WrapMap,wrap=store.wrap,unwrap=store.unwrap;function listAccessors(o,p){var out=p||O.create(null);return O.names(o).forEach(function(prop){var desc=O.describe(o,prop);if(desc.get||desc.set)out[prop]=desc}),out}var Interceptor=function(){function list(fwd,target){return fwd().concat(this.properties)}function owns(fwd,target,prop){return fwd()||prop in this.accessors}function Interceptor(name,accessors,proto){var brand="[object "+name+"]";this.accessors=accessors,this.prototype=proto,this.stringifier=Descriptor.hiddenValue(O.has(proto,"toString")?proto.toString:function toString(){return brand}),this.properties=O.keys(accessors)}return Interceptor.keys=Object.freeze(Object.create(null)),Interceptor.prototype={getter:function getter(target,prop){return this.accessors[prop].get.call(unwrap(target))},setter:function setter(target,prop,value){return this.accessors[prop].set.call(unwrap(target),value)},names:list,keys:list,enumerate:list,has:owns,owns:owns,iterate:function iterate(fwd,target){fwd.trap="enumerate";var props=this.enumerate(fwd,target),index=0;return{next:function(){if(props.length===index)throw StopIteration;return props[index++]}}},getProto:function getProto(fwd,target){return this.fakeproto},describe:function describe(fwd,target,prop){if(prop==="toString"&&!O.has(target,"toString"))return this.stringifier;if(prop in this.accessors){var desc=O.describeOwn(this.prototype,prop);return{enumerable:desc.enumerable,configurable:!0,writable:Boolean(desc.set),value:desc.get.call(unwrap(target))}}return fwd()},define:function define(fwd,target,prop,desc){return prop in this.accessors?this.setter(target,prop,desc.value):fwd()},get:function get(fwd,target,prop,rcvr){return prop==="toString"&&!O.has(target,"toString")?this.stringifier.value:prop in this.accessors?this.getter(target,prop):fwd()},set:function set(fwd,target,prop,value,rcvr){return prop in this.accessors?this.setter(target,prop,value):fwd()}},Interceptor}(),IndexedInterceptor=function(){var Ceptor=Interceptor.prototype;function numbers(start,end){isFinite(end)||(end=start,start=0);var length=end-start;if(end>numbers.cache.length)while(length--)numbers.cache[length+start]=length+start+"";return numbers.cache.slice(start,end)}numbers.cache=[];function list(fwd,target){return numbers(this.prototype.length.call(unwrap(target))).concat(this.properties,fwd())}function has(fwd,target,prop){return isFinite(prop)?prop<this.prototype.length.call(unwrap(target)):prop in this.accessors||fwd()}function IndexedInterceptor(name,accessors,proto){Interceptor.apply(this,arguments),this.properties.push("length")}var indexed=IndexedInterceptor.keys=Object.create(null);return indexed.get=!0,indexed.set=!0,indexed.length=!0,Object.freeze(indexed),IndexedInterceptor.prototype={__proto__:Ceptor,names:list,keys:list,enumerate:list,has:has,owns:has,describe:function(fwd,target,prop){return isFinite(prop)&&this.prototype.get?Descriptor.value(this.prototype.get.call(unwrap(target),prop)):prop==="length"?Descriptor.hiddenValue(this.prototype.length.call(unwrap(target)),!0):Ceptor.describe.apply(this,arguments)},define:function(fwd,target,prop,desc){return isFinite(prop)&&this.prototype.set?this.prototype.set.call(unwrap(target),prop,value):Ceptor.define.apply(this,arguments)},get:function(fwd,target,prop,rcvr){return isFinite(prop)&&this.prototype.get?this.prototype.get.call(unwrap(target),prop):prop==="length"?this.prototype.length.call(unwrap(target)):Ceptor.get.apply(this,arguments)},set:function(fwd,target,prop,value,rcvr){return isFinite(prop)&&this.prototype.set?this.prototype.set.call(unwrap(target),prop,value):Ceptor.set.apply(this,arguments)}},IndexedInterceptor}(),NamedInterceptor=function(){var Ceptor=Interceptor.prototype;function list(fwd,target){return this.prototype.list.call(unwrap(target)).concat(this.properties,fwd())}function has(fwd,target,prop){return fwd()||this.prototype.has.call(unwrap(target),prop)}function NamedInterceptor(name,accessors,proto){Interceptor.apply(this,arguments)}var named=NamedInterceptor.keys=Object.create(null);return named.get=!0,named.set=!0,named.has=!0,named.list=!0,Object.freeze(named),NamedInterceptor.prototype={__proto__:Ceptor,names:list,keys:list,enumerate:list,has:has,owns:has,describe:function(fwd,target,prop){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?Descriptor.value(this.prototype.get.call(inst,prop)):prop in this.accessors?Ceptor.describe.apply(this,arguments):prop in this.fakeproto?fwd():Descriptor.value(this.prototype.get.call(unwrap(target),prop))},define:function(fwd,target,prop,desc){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.set.call(inst,prop,desc.value):prop in this.accessors?this.setter(target,prop,desc.value):this.prototype.set.call(unwrap(target),prop,value)},get:function(fwd,target,prop,rcvr){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.get.call(inst,prop):prop in this.accessors?this.getter(target,prop):fwd()},set:function(fwd,target,prop,value,rcvr){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.set.call(inst,prop,value):prop in this.accessors?this.setter(target,prop,value):this.prototype.set.call(unwrap(target),prop,value)}},NamedInterceptor}(),Constructor=function(){var stringifier=Descriptor.hiddenValue(function toString(){return"function "+this.name+"() { [native code] }"});function Constructor(name,ctor,template){return this.template=template,this.ctor=ctor,proxy(Function("return function "+name+"(){}")(),this)}return Constructor.prototype={describe:function(fwd,target,prop){return prop==="prototype"?Descriptor.hiddenValue(this.template.fakeproto):prop==="toString"?stringifier:fwd()},get:function(fwd,target,prop,rcvr){return prop==="prototype"?this.template.fakeproto:prop==="toString"?stringifier.value:fwd()},apply:function(fwd,target,args,rcvr){var inst=Object.create(this.template.fakeproto),out=proxy(inst,this.template);return wrap(out,inst),this.ctor.apply(out,args),out},construct:function(fwd,target,args){var inst=Object.create(this.template.fakeproto),out=proxy(inst,this.template);return wrap(out,inst),this.ctor.apply(out,args),out}},Constructor}(),protos=new WeakMap;exports.interceptor=function interceptor(name,Ctor,inherits){typeof name=="function"&&(inherits=Ctor,Ctor=name,name=Ctor.name);var proto=Ctor.prototype,accessors=listAccessors(proto);inherits&&listAccessors(protos.get(inherits),accessors);var Template="length"in proto?IndexedInterceptor:"list"in proto?NamedInterceptor:Interceptor,template=new Template(name,accessors,proto),ctor=new Constructor(name,Ctor,template);return template.fakeproto=O.namesOwn(proto).reduce(function(ret,key){if(!(key in accessors||key in Template.keys)){var desc=O.describe(proto,key);key==="constructor"&&(desc.value=ctor),desc.enumerable=!1,O.define(ret,key,desc)}return ret},O.create(O.getProto(proto))),protos.set(template.fakeproto,proto),ctor}}(),!function(){var proxy=require("./proxy").proxy;function doppelganger(callable){var handler=new Doppelganger,doppel=proxy(handler.target,handler,callable);return function changeInfo(into){handler.target=Object(into);if(doppel)return[doppel,doppel=null][0]}}function Doppelganger(){this.target={}}function targeter(fwd){return fwd.target=this.target,fwd()}Doppelganger.prototype={getProto:targeter,setProto:targeter,names:targeter,describe:targeter,define:targeter,"delete":targeter,fix:targeter,keys:targeter,enumerate:targeter,owns:targeter,has:targeter,get:targeter,set:targeter,apply:targeter,construct:targeter},exports.doppelganger=doppelganger}(),!function(){var _Object=require("./utility").Object,HashMap=function(){var hashmaps=new WeakMap;function HashMap(){hashmaps.set(this,Object.create(null))}return _Object.extend(HashMap.prototype,[function has(key){return key in hashmaps.get(this)},function get(key){return hashmaps.get(this)[key]},function set(key,value){return hashmaps.get(this)[key]=value},function delete_(key){var ret=this.has(key);return ret&&delete hashmaps.get(this)[key],ret}]),HashMap}();function Store(values){_Object.isObject(values)&&this.set(values)}Store.prototype=Object.create(null,{set:{value:function set(key,value){_Object.isObject(key)?Object.keys(key).forEach(function(k){this[k]=key[k]},this):this[key]=value}},get:{value:function get(key){return Array.isArray(key)?key.reduce(function(r,k){return r[k]=this[k],r}.bind(this),{}):this[key]}},toString:{value:function toString(){return"[object Store]"}},valueOf:{value:Object.prototype.valueOf}}),exports.namespace=function namespace(){var ostore=new WeakMap,pstore=new HashMap;return function unwrap(target,values){var store=_Object.isObject(target)?ostore:pstore,data=store.get(target);return data||(data=new Store(values),store.set(target,data)),data}}}(),exports}({},this))
+"meta"in window||(window.meta=function(exports,global){"use strict";function require(s){return s=s.replace(/^[./]*/,""),typeof exports[s]=="function"?exports:exports[s]}return!function(){!function(global,exports){var FP=Function.prototype,OP=Object.prototype,AP=Array.prototype,RP=RegExp.prototype,DP=Date.prototype,bindbind=FP.bind.bind(FP.bind),callbind=bindbind(FP.call),applybind=bindbind(FP.apply),calling=callbind(FP.call),binding=callbind(FP.bind),applying=callbind(FP.apply),hasOwn=callbind(OP.hasOwnProperty),flatten=applybind(AP.concat),concat=callbind(AP.concat),map=callbind(AP.map),reduce=callbind(AP.reduce),create=Object.create,define=Object.defineProperty,defines=Object.defineProperties,describe=getPropertyDescriptor,describeAll=getPropertyDescriptors,describeAllOwn=getOwnPropertyDescriptors,describeOwn=Object.getOwnPropertyDescriptor,getProto=Object.getPrototypeOf,keys=Object.keys,names=getPropertyNames,namesOwn=Object.getOwnPropertyNames,types=[Array,Boolean,Date,Function,Number,Object,RegExp,String];function Descriptor(type,valueOrGet,readonlyOrSet,hidden,frozen){this[type?"setAccessors":"setValue"](valueOrGet,readonlyOrSet),hidden&&(this.enumerable=!1),frozen&&(this.configurable=!1)}Descriptor.VALUE=0,Descriptor.ACCESSOR=1,Descriptor.prototype={constructor:Descriptor,configurable:!0,enumerable:!0,setValue:function setValue(value,readonly){this.value=value,this.writable=!readonly},setAccessors:function setAccessors(get,set){this.get=get,this.set=set}};function getValue(d){if(d)return d.value}function value(v,h,r,f){return new Descriptor(0,v,r,h,f)}function hiddenValue(v,r,f){return new Descriptor(0,v,r,!0,f)}function accessor(g,s,h,f){return new Descriptor(1,g,s,h,f)}function hiddenAccessor(g,s,f){return new Descriptor(1,g,s,!0,f)}function isAccessor(desc){return isObject(desc)&&("get"in desc||"set"in desc)&&!("value"in desc)}function isValue(desc){return isObject(desc)&&!("get"in desc||"set"in desc)&&"value"in desc}function isBuiltin(o){return types.indexOf(o)>-1}function forEach(o,callback,context,hidden){context===!0?(hidden=!0,context=o):context=context||o,(hidden===!0?namesOwn:keys)(Object(o)).forEach(function(key){callback.call(context,o[key],key,o)})}function extend(to,from){to=Object(to),from=Object(from);if(isBuiltin(to)||keys(to).length===0&&names(to)>0)var desc=hiddenValue();else var desc=value();var fromBuiltin=isBuiltin(from);return!fromBuiltin&&Array.isArray(from)?from.forEach(function(item){typeof item=="function"&&item.name&&(desc.value=item,define(to,item.name.replace(/_$/,""),desc))}):(fromBuiltin?namesOwn:keys)(from).forEach(function(key){if(!hasOwn(to,key)&&!fromBuiltin||typeof from[key]=="function")desc.value=from[key],define(to,key,desc)}),arguments.length>2&&extend(to,arguments[2]),to}function make(o,p){return p?extend(create(o),p):create(o)}function clone(o){return create(getProto(o),describeAllOwn(o))}function isObject(o){return o!==null&&typeof o=="object"||typeof o=="function"}function isPrimitive(o){return o==null||typeof o!="object"&&typeof o!="function"}function setPrototypeOf(o,v){if(isObject(o)&&isObject(v)||v===null)o.__proto__=v;return v}function getPropertyDescriptor(o,n){while(isObject(o)){var desc=describeOwn(o,n);if(desc)return desc;o=getProto(o)}return undefined}function getPropertyNames(o){var out=[];while(isObject(o))out.push(namesOwn(o)),o=getProto(o);return unique(flatten([],out))}function getOwnPropertyDescriptors(o){var out={};return namesOwn(o).forEach(function(key){out[key]=describeOwn(o,key)}),out}function getPropertyDescriptors(o){var out={};return names(o).forEach(function(key){out[key]=describe(o,key)}),out}function allKeys(o){var out=[];while(isObject(o))out.push(keys(o)),o=getProto(o);return unique(flatten([],out))}function parameters(fn){return(fn+="").slice(fn.indexOf("(")+1,fn.indexOf(")")).split(/\s*,\s*/)}function unique(a){return keys(reduce(a,function(r,s){return r[s]=1,r},{}))}function setHidden(o,n,v){if(isObject(n)){for(var k in n)hasOwn(n,k)&&define(o,k,hiddenValue(n[k]));return this}return define(o,n,hiddenValue(v))}var slice=function(_slice){return function slice(a,o,p){switch(a.length){case 0:return[];case 1:return o?[]:[a[0]];default:return _slice.call(a,o,p);case 2:a=[a[0],a[1]]}return o||p?a.slice(o,p):a}}(AP.slice),monkeypatch=function(){var toString={configurable:!0,writable:!0,value:Function('return function toString(){ return "'+(Object+"").replace(/\n/g,"\\n").replace("Object",'"+this.name+"')+'" }')()};return define(toString.value,"toString",toString),function monkeypatch(o,v){return setHidden(o,v.name,v),typeof v=="function"&&v.toString!==toString.value&&define(v,"toString",toString),v}}();function stringify(o){var stringifier=stringify[brandName(o)]||stringify.Object;return stringifier(o)}var brandName=function(){var brands={};return types.forEach(function(Ctor){hasOwn(Ctor.prototype,"toString")&&(stringify[Ctor.name]=callbind(Ctor.prototype.toString)),brands["[object "+Ctor.name+"]"]=Ctor.name}),function brandName(o){var brand=stringify.Object(o);return brand in brands?brands[brand]:brand}}();exports.Descriptor=extend(Descriptor,{accessor:accessor,getValue:getValue,hiddenAccessor:hiddenAccessor,hiddenValue:hiddenValue,isAccessor:isAccessor,isValue:isValue,value:value}),exports.Object=extend(function Object(o){return o?global.Object(o):Object.create(null)},{allKeys:allKeys,brandName:brandName,extend:extend,forEach:forEach,getOwnPropertyDescriptors:getOwnPropertyDescriptors,getPropertyDescriptor:getPropertyDescriptor,getPropertyDescriptors:getPropertyDescriptors,getPropertyNames:getPropertyNames,hasOwn:hasOwn,isObject:isObject,isPrimitive:isPrimitive,monkeypatch:monkeypatch,setHidden:setHidden,setPrototypeOf:setPrototypeOf,stringify:stringify.Object},Object),exports.Function=extend({applybind:applybind,applying:applying,bindbind:bindbind,binding:binding,callbind:callbind,calling:calling,parameters:parameters,stringify:stringify.Function},Function),exports.Array=extend(function Array(n){return global.Array.apply(null,global.Array(n))},{flatten:flatten,slice:slice,stringify:stringify.Array,unique:unique},global.Array),namesOwn(AP).forEach(function(key){!exports.Array[key]&&typeof AP[key]=="function"&&(exports.Array[key]=callbind(AP[key]))});var wrappedNative=new WeakMap;exports.RegExp=function RegExp(s,t){if(!(this instanceof RegExp))return new RegExp(s,t);wrappedNative.set(this,new global.RegExp(s,t))},extend(exports.RegExp,{exec:callbind(RP.exec),execable:bindbind(RP.exec),stringify:stringify.RegExp,test:callbind(RP.test),testable:bindbind(RP.test)}),extend(exports.RegExp.prototype,{toString:function toString(){return exports.RegExp.stringify(wrappedNative.get(this))},valueOf:function valueOf(){return wrappedNative.get(this)},test:function test(s){return exports.RegExp.test(wrappedNative.get(this),s)},testable:function testable(){return exports.RegExp.testable(wrappedNative.get(this))},exec:function exec(s){return exports.RegExp.exec(wrappedNative.get(this),s)},execable:function execable(){return exports.RegExp.execable(wrappedNative.get(this))},split:function split(s){return s.split(wrappedNative.get(this))},match:function match(s){return s.match(wrappedNative.get(this))},replace:function replace(s,r){return s.replace(wrappedNative.get(this),r)}}),exports.Date=extend(function Date(p){return new(applybind(global.Date,flatten(null,p)))},{stringify:stringify.Date});var wrapped=new WeakMap;function O(o){if(!(this instanceof O))return new O(o);wrapped.set(this,Object(o))}var def=function define(o,n,v){return isObject(n)?Object.defineProperties(o,n):Object.defineProperty(o,n,v),o};exports.O=extend(O,{make:make,brand:brandName,create:Object.create,clone:clone,define:def,describe:getPropertyDescriptor,describeAll:getPropertyDescriptors,describeAllOwn:getOwnPropertyDescriptors,describeOwn:Object.getOwnPropertyDescriptor,each:forEach,extend:extend,getProto:Object.getPrototypeOf,has:hasOwn,isObj:isObject,keys:Object.keys,allKeys:allKeys,names:getPropertyNames,namesOwn:Object.getOwnPropertyNames,notObj:isPrimitive,setHidden:setHidden,setProto:setPrototypeOf,stringify:stringify}),O.prototype.unwrap=function(){return wrapped.get(this)},forEach(O,function(fn,key){typeof fn=="function"&&(O.prototype[key]=function(){return fn.apply(null,flatten(wrapped.get(this),arguments))})})}(Function("return this")(),typeof window!="undefined"?exports.utility={}:typeof exports=="undefined"?this:exports)}(),!function(){var _Object=require("./utility").Object;function lookup(o){if(!wrapmaps.has(o))throw new TypeError("WrapMaps are not generic");return wrapmaps.get(o)}var wrapmaps=new WeakMap;function WrapMap(wrapper){var wrapped=new WeakMap,unwrapped=new WeakMap;if(typeof wrapper=="function")var wrap=function wrap(o,isDescriptor){if(isDescriptor===!0)return wrapDescriptor(o);if(_Object.isPrimitive(o)||wrapped.has(o))return o;if(unwrapped.has(o))return unwrapped.get(o);var p=wrapper(o);return _Object.isObject(p)&&(wrapped.set(p,o),unwrapped.set(o,p)),p};else var wrap=function wrap(o,p){return _Object.isPrimitive(o)||wrapped.has(o)?o:unwrapped.has(o)?unwrapped.get(o):(_Object.isObject(p)&&(wrapped.set(p,o),unwrapped.set(o,p)),p)};function unwrap(o,isDescriptor){return isDescriptor===!0?unwrapDescriptor(o):_Object.isPrimitive(o)||!wrapped.has(o)?o:wrapped.get(o)}function has(o){return Object.isObject(o)&&wrapped.has(o)}function remove(o){var p=unwrap(o);return o!==p&&wrapped.delete(o),p}function wrapDescriptor(o){return _Object.isObject(o)&&!wrapped.has(o)&&(o.value&&(o.value=wrap(o.value)),o.set&&(o.set=wrap(o.set)),o.get&&(o.get=wrap(o.get))),o}function unwrapDescriptor(o){return _Object.isObject(o)&&wrapped.has(o)&&(o.value&&(o.value=unwrap(o.value)),o.set&&(o.set=unwrap(o.set)),o.get&&(o.get=unwrap(o.get))),o}var self=this===global?Object.create(WrapMap.prototype):this;return self.wrap=wrap,self.unwrap=unwrap,self.remove=remove,self.has=has,wrapmaps.set(self,{wrap:wrap,unwrap:unwrap,remove:remove,has:has}),self}WrapMap.prototype={constructor:WrapMap,wrap:function wrap(o,p){return lookup(this).wrap(o,p)},unwrap:function unwrap(o){return lookup(this).unwrap(o)},remove:function remove(o){return lookup(this).remove(o)},has:function has(o){return lookup(this).has(o)}},exports.WrapMap=WrapMap}(),!function(){var _Array=require("./utility").Array;function Event(type,target){this.type=type,this.target=target}function ErrorEvent(error,event,target){Event.call(this,"error",target),this.error=error,this.event=event}var emitters=new WeakMap,receivers=new WeakMap;function _(o){if(!emitters.has(o)){var ret={};return receivers.set(o,o),emitters.set(o,ret),ret}return emitters.get(o)}function Emitter(){emitters.set(this,{}),receivers.set(this,this)}Emitter.Event=Event,Emitter.forward=function forward(from,to){emitters.has(to)||(emitters.set(to,{}),receivers.set(to,to)),emitters.set(from,emitters.get(to)),from.on=Emitter.prototype.on.bind(to),from.off=Emitter.prototype.off.bind(to)},Emitter.prototype={constructor:Emitter,on:function on(events,listener){var listeners=_(this);events.split(" ").forEach(function(event){event in listeners?listeners[event].push(listener):listeners[event]=[listener]})},off:function off(events,listener){var listeners=_(this);events.split(" ").forEach(function(event){listeners[event]&&listeners[event].splice(listeners[event].indexOf(listener),1)})},offAll:function offAll(event){delete _(this)[event]},once:function once(event,listener){var self=this;this.on(event,function(){return self.off(event,listener),listener.apply(receivers.get(self),arguments)})},isListened:function isListened(type){var events=_(this),listeners=events[type]||events["*"];return Boolean(listeners&&listeners.length)},emit:function emit(type){var event,events=_(this);typeof type!="string"&&type.type&&(event=type,type=type.type);if(events["*"])var listeners=events[type]?events["*"].concat(events[type]):events["*"];else var listeners=events[type];if(listeners&&listeners.length){event=event||new Event(type,receivers.get(this));var args=[event].concat(_Array.slice(arguments,1));for(var i=0;i<listeners.length;i++)try{listeners[i].apply(this,args)}catch(e){this.emit(new ErrorEvent(e,event,listeners[i]))}}}},exports.Emitter=Emitter,exports.Event=Event}(),!function(){var utility=require("./utility"),_Function=utility.Function,_Object=utility.Object,_Array=utility.Array,O=utility.O,Descriptor=utility.Descriptor,createProxyObject=Proxy.create,createProxyFunction=Proxy.createFunction,wmhas=_Function.callbind(WeakMap.prototype.has),wmget=_Function.callbind(WeakMap.prototype.get),wmset=_Function.callbind(WeakMap.prototype.set),wmdelete=_Function.callbind(WeakMap.prototype.delete),wmhasget=function hasget(wm,obj){return _Object.isObject(obj)&&(wm=wmget(wm,obj))===undefined?obj:wm},checkArray=function(){var wrapped=new WeakMap,isArr=Array.isArray;return _Object.monkeypatch(Array,function isArray(){var a=arguments[0];return isArr(a)?!0:_Object.isPrimitive(a)?!1:wmhas(wrapped,a)}),function(o,p){isArr(o)&&wmset(wrapped,o,!0)}}(),checkToString=function(){var wrapped=new WeakMap;return[Function,RegExp,Object,Date].forEach(function(Ctor){var stringify=utility[Ctor.name].stringify;function toString(){return stringify(wmhasget(wrapped,this))}wmset(wrapped,toString,Ctor.prototype.toString),_Object.monkeypatch(Ctor.prototype,toString)}),function(o,p){wmset(wrapped,p,o)}}();typeof StopIteration=="undefined"&&(global.StopIteration=O.create(O.create(null)),_Object.monkeypatch(StopIteration.__proto__,function toString(){return"[object StopIteration]"}));function Iterator(next){this.next=next}function definer(o,n,v,newDesc){return o[n]=v,!0}function setter(desc,rcvr,val){var exists=desc.set!=null;return exists&&_Function.calling(desc.set,rcvr,val),exists}function configurable(desc){return desc&&(desc.configurable=!0),desc}var forwarder={getProto:function getProto(T){return O.getProto(T)},setProto:function setProto(T,V){return T.__proto__=V,!0},describe:function describe(T,N){return configurable(O.describeOwn(T,N))},define:function define(T,N,D){return O.define(T,N,D),!0},"delete":function delete_(T,N){return delete T[N]},fix:function fix(T){return Object.freeze(T)},keys:function keys(T){return O.keys(T)},names:function names(T){return O.namesOwn(T)},enumerate:function enumerate(T){return O.allKeys(T)},owns:function owns(T,N){return O.has(T,N)},has:function has(T,N){return N in T},get:function get(T,N,R){var handler=wmget(proxies,T);if(handler!=null)return wmget(handler,R,N);try{var desc=O.describeOwn(T,N)}catch(e){return unwrap(R)[N]}if(desc==null){var proto=O.getProto(T);if(proto!=null)return forwarder.get(proto,N,R)}else{if(Descriptor.isValue(desc))return desc.value;if(Descriptor.isAccessor(desc)&&typeof desc.get=="function")return _Function.calling(desc.get,R)}return undefined},set:function set(T,N,V,R){var handler=wmget(proxies,T);if(handler)return handler.set(R,N,V);try{var oDesc=O.describeOwn(T,N)}catch(e){return unwrap(R)[N]=V,!0}if(oDesc)return Descriptor.isAccessor(oDesc)?setter(oDesc,R,V):oDesc.writable?definer(R,N,V,R!==T):!1;var proto=O.getProto(T);return proto===null?definer(unwrap(R),N,V,!0):forwarder.set(proto,N,V,R)},apply:function apply(T,A,R){return _Function.applying(T,R,A)},construct:function construct(T,A){var handler=wmget(proxies,T);if(handler)return handler.construct(T,A);var result=new(_Function.applying(Function.bind,T,[null].concat(A)));return _Object.isObject(result)?result:O.create(T.prototype)},iterate:function iterate(T){var handler=wmget(proxies,T);if(handler)return handler.iterate(T);var enumerables=O.allKeys(T),index=0;return new Iterator(function(){if(index===enumerables.length)throw StopIteration;return enumerables[index++]})}};function unwrap(o){return wmget(targets,o)||o}var trapMap={getPrototypeOf:"getProto",setPrototypeOf:"setProto",getOwnPropertyDescriptor:"describe",getOwnPropertyNames:"names",defineProperty:"define","delete":"delete",fix:"fix",keys:"keys",enumerate:"enumerate",iterate:"iterate",hasOwn:"owns",has:"has",get:"get",set:"set",apply:"apply",construct:"construct"};_Object.monkeypatch(Object,function getPrototypeOf(o){return wmhas(proxies,o)?wmget(proxies,o).getPrototypeOf():O.getProto(o)});var proxies=new WeakMap,targets=new WeakMap;function proxy(target,handler,callable){if(!_Object.isObject(target))throw new TypeError("Target must be an object");if(!_Object.isObject(handler))throw new TypeError("Handler must be an object");function makeFwd(args,trap){var fwd=function(){return _Function.applying(forwarder[fwd.trap],handler,[fwd.target].concat(fwd.args))};return fwd.target=target,fwd.args=args,fwd.trap=trap,fwd}var metaHandler=createProxyObject({get:function get(R,trap){return trap==="getPropertyDescriptor"?function getPropertyDescriptor(n){return configurable(get(null,"getOwnPropertyDescriptor")(n)||O.describe(get(null,"getPrototypeOf")),n)}:trap==="getPropertyNames"?function getPropertyNames(){return _Array.unique(get(null,"getOwnPropertyNames")().concat(O.names(get(null,"getPrototypeOf"))))}:function metaget(){var args,after;if(arguments[0]==="__proto__"||arguments[1]==="__proto__")switch(trap){case"getOwnPropertyDescriptor":after=Descriptor.hiddenValue;case"get":args=[],trap="getProto";break;case"set":args=[arguments[2]],trap="setProto";break;case"defineProperty":args=[Descriptor.getValue(arguments[1])],trap="setProto"}else if(trap==="get")args=[arguments[1],arguments[0]];else if(trap==="set")args=[arguments[1],arguments[2],arguments[0]];else{if(!trapMap[trap])throw Error('Unknown trap "'+trap+'"');trap=trapMap[trap],args=_Array.slice(arguments)}var trapHandler=handler[trap];if(typeof trapHandler!="function")var ret=_Function.applying(forwarder[trap],handler,[target].concat(args));else var ret=_Function.applying(trapHandler,handler,[makeFwd(args,trap),target].concat(args));return after?after(ret):ret}}});if(callable===!0||callable==null&&typeof target=="function")var reflectProxy=createProxyFunction(metaHandler,function(){return metaHandler.apply(_Array.slice(arguments),this)},function(){return metaHandler.construct(_Array.slice(arguments))});else var reflectProxy=createProxyObject(metaHandler,O.getProto(target));return wmset(proxies,reflectProxy,metaHandler),wmset(targets,reflectProxy,target),checkArray(target,reflectProxy),checkToString(target,reflectProxy),reflectProxy}exports.proxy=proxy}(),!function(){var _Array=require("./utility").Array,_Function=require("./utility").Function,_Object=require("./utility").Object,proxy=require("./proxy").proxy,WrapMap=require("./WrapMap").WrapMap,fakehandler={};function membrane(handlers){if(_Object.isPrimitive(handlers))throw Error("Handlers must be provided");var wrapper=new WrapMap(function(target){return proxy(target,proxy(fakehandler,{get:function membraneHandlerGet(f,t,trap){return function membraneMetaHandler(fwd,faketarget){var handler=handlers[trap],args=_Array.slice(arguments);args[1]=fwd.target=wrapper.unwrap(faketarget);if(handler){var origfwd=fwd;fwd=function fwd(){return _Function.applying(handler,handlers,args)},fwd.args=origfwd.args}return _Function.applying(wrapHandler[trap],null,_Array.concat([fwd],_Array.slice(args,1)))}}}))});function forward(fwd){return fwd()}var wrapHandler={names:forward,enumerate:forward,keys:forward,"delete":forward,owns:forward,has:function has(){return!0},getProto:function getProto(fwd,target){return wrapper.wrap(fwd())},setProto:function setProto(fwd,target,value){return fwd.args[0]=wrapper.unwrap(value),wrapper.wrap(fwd())},fix:function fix(fwd,target){throw target},define:function define(fwd,target,name,desc){return wrapper.unwrap(desc,!0),fwd()},describe:function describe(fwd,target,name){return wrapper.wrap(fwd(),!0)},get:function get(fwd,target,name,rcvr){return fwd.args[1]=wrapper.unwrap(rcvr),wrapper.wrap(fwd())},set:function set(fwd,target,name,val,rcvr){return fwd.args[1]=wrapper.unwrap(val),fwd.args[2]=wrapper.unwrap(rcvr),fwd()},apply:function apply(fwd,target,args,rcvr){return fwd.args[0]=_Array.map(args,wrapper.unwrap),fwd.args[1]=wrapper.unwrap(rcvr),wrapper.wrap(fwd())},construct:function construct(fwd,target,args){return fwd.args[0]=_Array.map(args,wrapper.unwrap),wrapper.wrap(fwd())}};return wrapper}exports.membrane=membrane}(),!function(){var proxy=require("./proxy").proxy,_Array=require("./utility").Array,_Function=require("./utility").Function,O=require("./utility").O;function multiherit(o){o.params=o.params||[];var arglist=o.ctors.map(function(ctor,i){return Array.isArray(o.params[i])?o.params[i]:_Function.parameters(ctor).map(function(param){return o.params.indexOf(param)})}),protos=o.ctors.map(function(ctor){return ctor.prototype});return new MultiCtor(new Multiproto(protos),arglist,o)}function MultiCtor(proto,params,o){var ctors=o.ctors;function Ctor(){var args=arguments;for(var i=0;i<ctors.length;i++)_Function.applying(ctors[i],this,params[i].map(function(i){return args[i]}));return this}return Ctor.prototype=proto,proto.constructor=Ctor,this.name=o.name||ctors.map(function(ctor){return ctor.name}).join(""),this.createInstance=instanceCreator(proto,o.onCall,o.onConstruct),proxy(Ctor,this)}function toString(){return"function "+this.name+"() { [native code] }"}MultiCtor.prototype={get:function(fwd,target,name,rcvr){return name==="name"?this.name:name==="toString"?toString:fwd()},describe:function(fwd,target,name){if(name==="name"){var desc=fwd();return desc.value=this.name,desc}return fwd()},call:function(fwd,target,args,rcvr){return this.construct(fwd,target,args)},construct:function(fwd,target,args){return _Function.applying(target,this.createInstance(),args)}};function instanceCreator(proto,call,construct){if(call||construct){var handler={apply:function(fwd,target,args,rcvr){return _Function.applying(call,rcvr,args)},construct:function(fwd,target,args){return construct?_Function.applying(construct,Object.create(target.prototype),args):_Function.applying(call,global,args)}};return function(){var fake=function(){};return fake.__proto__=proto,proxy(fake,handler)}}return function(){return Object.create(proto)}}function Multiproto(protos){this.protos=protos=Object.freeze(protos.slice());var proto=Object.create(null,{inherits:{configurable:!0,value:protos}});return proxy(proto,this)}Multiproto.prototype=function(){function list(fwd,target){return _Array.unique(this.protos.reduce(function(ret,proto){return fwd.target=proto,ret.concat(fwd())},fwd())).filter(function(s){return!(s in Object.prototype)})}function has(fwd,target,name){if(fwd())return!0;for(var i=0;i<this.protos.length;i++){fwd.target=this.protos[i];if(fwd())return!0}return!1}return{names:list,keys:list,enumerate:list,hasOwn:has,has:has,describe:function(fwd,target,name){var desc=fwd();if(desc)return desc;for(var i=0;i<this.protos.length;i++){fwd.target=this.protos[i],desc=fwd();if(desc)return desc}return undefined},get:function(fwd,target,name,rcvr){var ret,i=0;while(typeof ret=="undefined"&&fwd.target)ret=fwd(),fwd.target=this.protos[i++];return ret}}}(),exports.multiherit=multiherit}(),!function(){var proxy=require("./proxy").proxy,membrane=require("./membrane").membrane,Emitter=require("./Emitter").Emitter;function TraceEmitter(object,name){var self=this instanceof TraceEmitter?this:Object.create(TraceEmitter.prototype);name=name||"root",Emitter.call(this);var wrapper=membrane(proxy({},{get:function get(f,t,trap){return function(fwd,target,prop){var ret=fwd();return self.emit(new TraceEvent(trap,target,fwd.args,ret)),ret}}}));this.unwrap=wrapper.unwrap,this[name]=wrapper.wrap(object)}TraceEmitter.prototype=Object.create(Emitter.prototype),TraceEmitter.prototype.constructor=TraceEmitter;function TraceEvent(type,target,args,result){this.type=type,this.target=target,this.result=result;var i=0;switch(type){case"keys":case"names":case"enumerate":case"fix":case"getProto":break;case"setProto":this.value=args[0];break;case"set":this.result===!0&&delete this.result;case"define":this.value=args[1];case"get":case"describe":this.property=args[0];break;case"apply":this.context=args[1];case"construct":this.name=target.name,this.args=args[0]}}TraceEvent.prototype=Object.create(Emitter.Event.prototype),TraceEvent.prototype.constructor=TraceEvent,exports.tracer=function tracer(object,name){return new TraceEmitter(object,name)},exports.TraceEmitter=TraceEmitter,exports.TraceEvent=TraceEvent}(),!function(){var _Function=require("./utility").Function,_Object=require("./utility").Object,proxy=require("./proxy").proxy;function callable(obj){return proxy(obj,handler,!0)}function list(fwd){return fwd().filter(function(s){return s!=="$$call"&&s!=="$$construct"&&!_Object.hasOwn(s)})}var handler={enumerate:list,keys:list,names:list,apply:function(fwd,target,args,rcvr){var call=target.$$call;return call?_Function.applying(call,target,args):undefined},construct:function(fwd,target,args){var construct=target.$$construct,instance=proxy(Object.create(target),handler,!0);if(construct){var result=_Function.applying(construct,instance,args);return _Object.isObject(result)?result:instance}return instance}};exports.callable=callable}(),!function(){var O=require("./utility").O,proxy=require("./proxy").proxy,WrapMap=require("./WrapMap").WrapMap,Descriptor=require("./utility").Descriptor,store=new WrapMap,wrap=store.wrap,unwrap=store.unwrap;function listAccessors(o,p){var out=p||O.create(null);return O.names(o).forEach(function(prop){var desc=O.describe(o,prop);if(desc.get||desc.set)out[prop]=desc}),out}var Interceptor=function(){function list(fwd,target){return fwd().concat(this.properties)}function owns(fwd,target,prop){return fwd()||prop in this.accessors}function Interceptor(name,accessors,proto){var brand="[object "+name+"]";this.accessors=accessors,this.prototype=proto,this.stringifier=Descriptor.hiddenValue(O.has(proto,"toString")?proto.toString:function toString(){return brand}),this.properties=O.keys(accessors)}return Interceptor.keys=Object.freeze(Object.create(null)),Interceptor.prototype={getter:function getter(target,prop){return this.accessors[prop].get.call(unwrap(target))},setter:function setter(target,prop,value){return this.accessors[prop].set.call(unwrap(target),value)},names:list,keys:list,enumerate:list,has:owns,owns:owns,iterate:function iterate(fwd,target){fwd.trap="enumerate";var props=this.enumerate(fwd,target),index=0;return{next:function(){if(props.length===index)throw StopIteration;return props[index++]}}},getProto:function getProto(fwd,target){return this.fakeproto},describe:function describe(fwd,target,prop){if(prop==="toString"&&!O.has(target,"toString"))return this.stringifier;if(prop in this.accessors){var desc=O.describeOwn(this.prototype,prop);return{enumerable:desc.enumerable,configurable:!0,writable:Boolean(desc.set),value:desc.get.call(unwrap(target))}}return fwd()},define:function define(fwd,target,prop,desc){return prop in this.accessors?this.setter(target,prop,desc.value):fwd()},get:function get(fwd,target,prop,rcvr){return prop==="toString"&&!O.has(target,"toString")?this.stringifier.value:prop in this.accessors?this.getter(target,prop):fwd()},set:function set(fwd,target,prop,value,rcvr){return prop in this.accessors?this.setter(target,prop,value):fwd()}},Interceptor}(),IndexedInterceptor=function(){var Ceptor=Interceptor.prototype;function numbers(start,end){isFinite(end)||(end=start,start=0);var length=end-start;if(end>numbers.cache.length)while(length--)numbers.cache[length+start]=length+start+"";return numbers.cache.slice(start,end)}numbers.cache=[];function list(fwd,target){return numbers(this.prototype.length.call(unwrap(target))).concat(this.properties,fwd())}function has(fwd,target,prop){return isFinite(prop)?prop<this.prototype.length.call(unwrap(target)):prop in this.accessors||fwd()}function IndexedInterceptor(name,accessors,proto){Interceptor.apply(this,arguments),this.properties.push("length")}var indexed=IndexedInterceptor.keys=Object.create(null);return indexed.get=!0,indexed.set=!0,indexed.length=!0,Object.freeze(indexed),IndexedInterceptor.prototype={__proto__:Ceptor,names:list,keys:list,enumerate:list,has:has,owns:has,describe:function(fwd,target,prop){return isFinite(prop)&&this.prototype.get?Descriptor.value(this.prototype.get.call(unwrap(target),prop)):prop==="length"?Descriptor.hiddenValue(this.prototype.length.call(unwrap(target)),!0):Ceptor.describe.apply(this,arguments)},define:function(fwd,target,prop,desc){return isFinite(prop)&&this.prototype.set?this.prototype.set.call(unwrap(target),prop,value):Ceptor.define.apply(this,arguments)},get:function(fwd,target,prop,rcvr){return isFinite(prop)&&this.prototype.get?this.prototype.get.call(unwrap(target),prop):prop==="length"?this.prototype.length.call(unwrap(target)):Ceptor.get.apply(this,arguments)},set:function(fwd,target,prop,value,rcvr){return isFinite(prop)&&this.prototype.set?this.prototype.set.call(unwrap(target),prop,value):Ceptor.set.apply(this,arguments)}},IndexedInterceptor}(),NamedInterceptor=function(){var Ceptor=Interceptor.prototype;function list(fwd,target){return this.prototype.list.call(unwrap(target)).concat(this.properties,fwd())}function has(fwd,target,prop){return fwd()||this.prototype.has.call(unwrap(target),prop)}function NamedInterceptor(name,accessors,proto){Interceptor.apply(this,arguments)}var named=NamedInterceptor.keys=Object.create(null);return named.get=!0,named.set=!0,named.has=!0,named.list=!0,Object.freeze(named),NamedInterceptor.prototype={__proto__:Ceptor,names:list,keys:list,enumerate:list,has:has,owns:has,describe:function(fwd,target,prop){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?Descriptor.value(this.prototype.get.call(inst,prop)):prop in this.accessors?Ceptor.describe.apply(this,arguments):prop in this.fakeproto?fwd():Descriptor.value(this.prototype.get.call(unwrap(target),prop))},define:function(fwd,target,prop,desc){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.set.call(inst,prop,desc.value):prop in this.accessors?this.setter(target,prop,desc.value):this.prototype.set.call(unwrap(target),prop,value)},get:function(fwd,target,prop,rcvr){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.get.call(inst,prop):prop in this.accessors?this.getter(target,prop):fwd()},set:function(fwd,target,prop,value,rcvr){var inst=unwrap(target);return this.prototype.has.call(inst,prop)?this.prototype.set.call(inst,prop,value):prop in this.accessors?this.setter(target,prop,value):this.prototype.set.call(unwrap(target),prop,value)}},NamedInterceptor}(),Constructor=function(){var stringifier=Descriptor.hiddenValue(function toString(){return"function "+this.name+"() { [native code] }"});function Constructor(name,ctor,template){return this.template=template,this.ctor=ctor,proxy(Function("return function "+name+"(){}")(),this)}return Constructor.prototype={describe:function(fwd,target,prop){return prop==="prototype"?Descriptor.hiddenValue(this.template.fakeproto):prop==="toString"?stringifier:fwd()},get:function(fwd,target,prop,rcvr){return prop==="prototype"?this.template.fakeproto:prop==="toString"?stringifier.value:fwd()},apply:function(fwd,target,args,rcvr){var inst=Object.create(this.template.fakeproto),out=proxy(inst,this.template);return wrap(out,inst),this.ctor.apply(out,args),out},construct:function(fwd,target,args){var inst=Object.create(this.template.fakeproto),out=proxy(inst,this.template);return wrap(out,inst),this.ctor.apply(out,args),out}},Constructor}(),protos=new WeakMap;exports.interceptor=function interceptor(name,Ctor,inherits){typeof name=="function"&&(inherits=Ctor,Ctor=name,name=Ctor.name);var proto=Ctor.prototype,accessors=listAccessors(proto);inherits&&listAccessors(protos.get(inherits),accessors);var Template="length"in proto?IndexedInterceptor:"list"in proto?NamedInterceptor:Interceptor,template=new Template(name,accessors,proto),ctor=new Constructor(name,Ctor,template);return template.fakeproto=O.namesOwn(proto).reduce(function(ret,key){if(!(key in accessors||key in Template.keys)){var desc=O.describe(proto,key);key==="constructor"&&(desc.value=ctor),desc.enumerable=!1,O.define(ret,key,desc)}return ret},O.create(O.getProto(proto))),protos.set(template.fakeproto,proto),ctor}}(),!function(){var proxy=require("./proxy").proxy;function doppelganger(callable){var handler=new Doppelganger,doppel=proxy(handler.target,handler,callable);return function changeInfo(into){handler.target=Object(into);if(doppel)return[doppel,doppel=null][0]}}function Doppelganger(){this.target={}}function targeter(fwd){return fwd.target=this.target,fwd()}Doppelganger.prototype={getProto:targeter,setProto:targeter,names:targeter,describe:targeter,define:targeter,"delete":targeter,fix:targeter,keys:targeter,enumerate:targeter,owns:targeter,has:targeter,get:targeter,set:targeter,apply:targeter,construct:targeter},exports.doppelganger=doppelganger}(),!function(){var _Object=require("./utility").Object,HashMap=function(){var hashmaps=new WeakMap;function HashMap(){hashmaps.set(this,Object.create(null))}return _Object.extend(HashMap.prototype,[function has(key){return key in hashmaps.get(this)},function get(key){return hashmaps.get(this)[key]},function set(key,value){return hashmaps.get(this)[key]=value},function delete_(key){var ret=this.has(key);return ret&&delete hashmaps.get(this)[key],ret}]),HashMap}();function Store(values){_Object.isObject(values)&&this.set(values)}Store.prototype=Object.create(null,{set:{value:function set(key,value){_Object.isObject(key)?Object.keys(key).forEach(function(k){this[k]=key[k]},this):this[key]=value}},get:{value:function get(key){return Array.isArray(key)?key.reduce(function(r,k){return r[k]=this[k],r}.bind(this),{}):this[key]}},toString:{value:function toString(){return"[object Store]"}},valueOf:{value:Object.prototype.valueOf}}),exports.namespace=function namespace(){var ostore=new WeakMap,pstore=new HashMap;return function unwrap(target,values){var store=_Object.isObject(target)?ostore:pstore,data=store.get(target);return data||(data=new Store(values),store.set(target,data)),data}}}(),exports}({},this))
Please sign in to comment.
Something went wrong with that request. Please try again.