No need for documentation. Just look at the source .
The Prologue directive is the longest sequence of ExpressionStatement productions occurring as the original output of the SourceElement Program or FunctionBody and where each ExpressionStatement in the sequence consists solely of the StringLiteral token following the semicolon. The semicolon may be displayed explicitly or an automatic semicolon may be inserted. The Prolog directive may be an empty sequence.
A Use of a strict directive is an ExpressionStatement expression in the Prolog directive whose StringLiteral is either the exact sequence of characters "use strict" or "use strict". Using a strict directive may not contain EscapeSequence or LineContinuation.
The Prologue directive may contain several rules for using Strict. However, an implementation may issue a warning if this happens.
In other words, Directive Prologue is the longest string literal sequence + semicolon when a function or program starts up accurately (top-level code):
(function(){ "use strict";
or
(function() { // Directive Prologue start "foo bar" "baz"; '123'; ''; // Directive Prologue end })();
or
'blah';
Note that once a string literal is not the first statement, it is no longer a directory prolog:
var x; "use strict";
or
(function() { 1 + "use magic";
source share