Skip to content

Commit

Permalink
Don't index 'undefined' nodes generated from default parameters trans…
Browse files Browse the repository at this point in the history
…pilation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208266009
  • Loading branch information
nbeloglazov authored and lauraharker committed Aug 14, 2018
1 parent 1e35eec commit b082cc1
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -726,6 +726,8 @@ private void visitDestructuringPatternInCatch(NodeTraversal t, Node pattern) {
* Helper for transpiling DEFAULT_VALUE trees.
*/
private static Node defaultValueHook(Node getprop, Node defaultValue) {
return IR.hook(IR.sheq(getprop, IR.name("undefined")), defaultValue, getprop.cloneTree());
Node undefined = IR.name("undefined");
undefined.makeNonIndexable();
return IR.hook(IR.sheq(getprop, undefined), defaultValue, getprop.cloneTree());
}
}

0 comments on commit b082cc1

Please sign in to comment.