简体   繁体   English

Getter Memoization 浏览器兼容性

[英]Getter Memoization browser compatibility

Referencing: Smart self overwriting lazy getters参考: 智能自我覆盖懒惰的吸气剂

Does any one know if there are any caveats to being able to depend on the browser memoization for these getters?有谁知道对于这些 getter 依赖浏览器记忆是否有任何注意事项?

By caveat I mean: Do different browsers choose to not memoize these values?警告我的意思是:不同的浏览器是否选择不记住这些值?

Do different browsers choose to not memoize these values?不同的浏览器是否选择不记住这些值?

No, why would they?不,他们为什么要? This technique works in every ES5-compliant browser, as it only requires getters (and maybe Object.defineProperty ) - which have nothing to do with ES6, btw.这种技术适用于每个符合 ES5 的浏览器,因为它只需要 getter(可能还有Object.defineProperty )——这与 ES6 无关,顺便说一句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM