Javascript:除了“use strict”之外,还有哪些其他“use”指令?

2024-05-02

Besides use strict,还有哪一个use有指令吗?


“指令序言”(JavaScript 引擎可能使用的部分)中还有一些示例:

  • 'use strict';
  • 'use asm';
    莫斯拉的asm.js http://asmjs.org/是该语言的一个子集,专门用于处理数字。
  • 'use stricter';
    Google's SoundScript. For fast OOP
    Has also some modes like:
    • 'use stricter+types';
    • http://www.2ality.com/2015/02/soundscript.html http://www.2ality.com/2015/02/soundscript.html
  • 'use babel';
    用于Atom.io http://blog.atom.io/2015/02/04/built-in-6to5.html。 (之前是:'use 6to5';)

一条推文由杰里米·阿什肯纳斯 https://twitter.com/jashkenas/status/562996829777059840建议进一步使用+ and -相同的前缀'use ...';细绳 ('use stricter +types -tco +jsx +asm +es2019-pre';),但这似乎与spec http://www.ecma-international.org/ecma-262/5.1/#sec-14.1(进一步澄清康加克斯的回答 https://stackoverflow.com/a/28890155/588079 and 贝尔吉的回答 https://stackoverflow.com/a/14969693/588079).

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Javascript:除了“use strict”之外,还有哪些其他“use”指令? 的相关文章

随机推荐