ECMAScript multiple Prologue Directives

前端 未结 2 644
长情又很酷
长情又很酷 2021-01-14 13:34

Certain ECMAScript environments permit switiching into a special mode by means of a Directive Prologue. ECMAScript 5 has \"use strict\" and others such as asm have their own

2条回答
  •  孤街浪徒
    2021-01-14 14:09

    Since no one answered it, but I found the answer and it was confirmed in a comment I'm answering my own to close it.

    Yes, to use multiple directives in a prologue list them one after the other like so:

    function(){
      "use foo";
      "use bar";
    }
    

    or

    function(){
      "use foo"; "use bar";
    }
    

提交回复
热议问题