Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Create global properties for sloppy function hosting as vars #888

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -40457,11 +40457,11 @@ <h1>Changes to GlobalDeclarationInstantiation</h1>
1. Let _F_ be StringValue of the |BindingIdentifier| of |FunctionDeclaration| _f_.
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _script_, then
1. If _envRec_.HasLexicalDeclaration(_F_) is *false*, then
1. Let _fnDefinable_ be ? _envRec_.CanDeclareGlobalFunction(_F_).
1. Let _fnDefinable_ be ? _envRec_.CanDeclareGlobalVar(_F_).
1. If _fnDefinable_ is *true*, then
1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName nor the name of another |FunctionDeclaration|.
1. If _declaredFunctionOrVarNames_ does not contain _F_, then
1. Perform ? _envRec_.CreateGlobalFunctionBinding(_F_, *undefined*, *false*).
1. Perform ? _envRec_.CreateGlobalVarBinding(_F_, *false*).
1. Append _F_ to _declaredFunctionOrVarNames_.
1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in <emu-xref href="#sec-function-definitions-runtime-semantics-evaluation"></emu-xref>:
1. Let _genv_ be the running execution context's VariableEnvironment.
Expand Down Expand Up @@ -40495,15 +40495,15 @@ <h1>Changes to EvalDeclarationInstantiation</h1>
1. Let _thisLex_ be _thisLex_'s outer environment reference.
1. If _bindingExists_ is *false* and _varEnvRec_ is a global Environment Record, then
1. If _varEnvRec_.HasLexicalDeclaration(_F_) is *false*, then
1. Let _fnDefinable_ be ? _varEnvRec_.CanDeclareGlobalFunction(_F_).
1. Let _fnDefinable_ be ? _varEnvRec_.CanDeclareGlobalVar(_F_).
1. Else,
1. Let _fnDefinable_ be *false*.
1. Else,
1. Let _fnDefinable_ be *true*.
1. If _bindingExists_ is *false* and _fnDefinable_ is *true*, then
1. If _declaredFunctionOrVarNames_ does not contain _F_, then
1. If _varEnvRec_ is a global Environment Record, then
1. Perform ? _varEnvRec_.CreateGlobalFunctionBinding(_F_, *undefined*, *true*).
1. Perform ? _varEnvRec_.CreateGlobalVarBinding(_F_, *true*).
1. Else,
1. Let _bindingExists_ be _varEnvRec_.HasBinding(_F_).
1. If _bindingExists_ is *false*, then
Expand Down