fholm / IronJS

IronJS - A JavaScript implementation for .NET
http://ironjs.wordpress.com
Apache License 2.0
680 stars 79 forks source link

Implement Directive Prologues #52

Open ChaosPandion opened 13 years ago

ChaosPandion commented 13 years ago

A Directive Prologue is the longest sequence of ExpressionStatement productions occurring as the initial SourceElement productions of a Program or FunctionBody and where each ExpressionStatement in the sequence consists entirely of a StringLiteral token followed a semicolon. The semicolon may appear explicitly or may be inserted by automatic semicolon insertion. A Directive Prologue may be an empty sequence.

An immutable set of directive prologues should be available to the currently executing code. This will be used to support strict mode code.

Possible Implementations

  1. Bit flags
  2. A case insensitive set of strings
  3. A object containing properties that correspond to directive prologues