fix bug in setting of __proto__ in function constructor

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4313 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
msridhar1 2012-01-06 21:20:28 +00:00
parent 1673a200e5
commit bf66d29491
1 changed files with 2 additions and 2 deletions

View File

@ -362,8 +362,7 @@ public class JavaScriptConstructTargetSelector implements MethodTargetSelector {
S.addStatement(insts.NewInstruction(7, NewSiteReference.make(S.getNextProgramCounter(), JavaScriptTypes.Object)));
// TODO fix these writes to operate on __proto__, once we're sure we're doing the right thing here
S.addStatement(insts.PutInstruction(7, 4, "prototype"));
S.addStatement(insts.PutInstruction(5, 4, "__proto__"));
S.getNextProgramCounter();
S.addStatement(insts.PutInstruction(5, 7, "prototype"));
@ -372,6 +371,7 @@ public class JavaScriptConstructTargetSelector implements MethodTargetSelector {
S.addStatement(insts.PutInstruction(7, 5, "constructor"));
S.getNextProgramCounter();
// TODO we need to set v7.__proto__ to Object.prototype
S.addStatement(insts.ReturnInstruction(5, false));
S.getNextProgramCounter();