HE Shi-Jun

Results 543 comments of HE Shi-Jun

I am considering maybe `lastValue@yield` could work 😂 though it still not solve: > - `yield.xxx` (or `xxx@yield`) implies something caused by `yield` but actually the main reason of this...

另外一个问题是自动适应高度。seamless属性最近不幸的被从spec里删除,因为没有人实现了它——除了UC!(Chrome曾实现了它但一直需要开启flag,并且早在Chrome27+之后就删除之。) seamless的问题可能是略复杂,浏览器厂商出于简(偷)化(懒),就把这需求踢给了 shadow dom。但是实际上 shadow dom 并不能同时满足 sandbox 的需求。 目前的 workaround: A. 同源内容并`onload="this.style.height = this.contentDocument.documentElement.offsetHeight + 'px'"` 注意,对于sandbox需要`sandbox=allow-same-origin` B. 在内容中插入脚本通过 postMessage 上报 embed-size 消息报告 height,[amp-iframe](https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/amp-iframe.md#iframe-resizing) 即采用此模式。 注意,对于sandbox需要`sandbox=allow-script` 这两种方式都略增加了风险。 我相对更prefer后者,因为可以通过csp的`script-src`限制脚本来源。但是低版本IE使用`security=restricted`可能有问题,需要单独考虑。

> 文末说的,没法区分装箱的类型,这是什么意思啊? @Liugq5713 仔细阅读,文章里已经解释了。

装箱就是指把primitive值包装成对象。 参见 https://en.wikipedia.org/wiki/Object_type_(object-oriented_programming)

@bmeck I think the use case could be easily solved by: ```js const ::{slice} from Array function copyArray(arr) { return arr::slice(); } ``` or ```js // extract all methods from...

@ljharb It does. > `str.startsWith(obj)` will check `obj[Symbol.match]` If there is truthy value, `startsWith` will throw. Having `Symbol.match` means it's an regexp-like object, and `startsWith`/`endsWith`/`includes` do not accept regexp-like objects...

@ljharb But the defensive code do not know whether it's object or primitive ? Or at least need to check type before using. Anyway, even in this case it's ok,...

Oh, that's another reason we need strong brand check :-)

After rethink of the symbol, I realize that the problem is not whether it's symbol or string, but whether the keyed methods are tend to be static or virtual (aka....

> or that Set/Map calls add/set Could u say more about this? I don't get it.