摘要: In contrast to other built-ins, Arrays can be wrapped transparently: const p = new Proxy(new Array(), {}); p.push('a'); assert.equal(p.length, 1); p.l 阅读全文
posted @ 2020-08-27 02:52 Zhentiw 阅读(164) 评论(0) 推荐(0)
摘要: Instances of most built-in constructors also use a mechanism that is not intercepted by Proxies. They therefore can’t be wrapped transparently, either 阅读全文
posted @ 2020-08-27 02:50 Zhentiw 阅读(151) 评论(0) 推荐(0)
摘要: For a Proxy, function signature looks like: const target = {} const handler = { get(target, propKey) { return Reflect.get(target, propKey) } } const p 阅读全文
posted @ 2020-08-27 02:46 Zhentiw 阅读(139) 评论(0) 推荐(0)