Bug Tracker

Changes between Initial Version and Version 1 of Ticket #13714, comment 13


Ignore:
Timestamp:
Apr 2, 2013, 6:59:00 PM (6 years ago)
Author:
Rick Waldron
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13714, comment 13

    initial v1  
    22> Now ES5 eval acting differently if the code is strict doesn't make a lot of sense to me: the same code, executed in a script tag would have the vars declared globally, so why on earth is the standard asking for eval to change its semantics? Am I missing something huge here? Isn't it a bug in the standard?
    33
    4 No bug. Strict mode must ensure static scoping semantics, which includes scope determinism. Specifically, global scope isn't implied the same way it is in non-strict mode. Also, if you could eval "strict mode" code in the global scope, should the the global environment record's strict flag then be set to true? I hope we all answered "no" to that question, since the "strict-ness" is static, not dynamic. Creating a fresh environment record to execute eval code with "use strict" is the only sane semantics
     4No bug. Strict mode must ensure static scoping semantics, which includes scope determinism. Specifically, global scope isn't implied the same way it is in non-strict mode. Also, if you could eval "strict mode" code in the global scope, should the the global environment record's strict flag then be set to true? I hope we all answered "no" to that question, since the "strict-ness" is static, not dynamic. Creating a fresh environment record to execute global eval code with "use strict" is the only sane semantics
    55
    66