From 8fc7af5480bb4f190cc3c295f292ffa4694a1ff3 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 19 Jan 2015 08:35:01 +1100 Subject: [PATCH] properly reference method body - fixes #530 --- lib/6to5/transformation/helpers/replace-supers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/helpers/replace-supers.js b/lib/6to5/transformation/helpers/replace-supers.js index 4ec70cf6b5..2403e878cb 100644 --- a/lib/6to5/transformation/helpers/replace-supers.js +++ b/lib/6to5/transformation/helpers/replace-supers.js @@ -152,7 +152,7 @@ ReplaceSupers.prototype.getThisReference = function () { return this.topLevelThisReference; } else { var ref = this.topLevelThisReference = this.file.generateUidIdentifier("this"); - this.methodNode.body.body.unshift(t.variableDeclaration("var", [ + this.methodNode.value.body.body.unshift(t.variableDeclaration("var", [ t.variableDeclarator(this.topLevelThisReference, t.thisExpression()) ])); return ref;