1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Fix prototype property being read-only

Fix #3
This commit is contained in:
Robert Krimen
2012-10-15 22:12:36 -07:00
parent 235c19bd71
commit defac5b22e
2 changed files with 14 additions and 1 deletions

View File

@@ -736,7 +736,7 @@ func (runtime *_runtime) newNodeFunction(node *_functionNode, scopeEnvironment _
self := runtime.newNodeFunctionObject(node, scopeEnvironment)
self.Prototype = runtime.Global.FunctionPrototype
prototype := runtime.newObject()
self.define(_propertyMode(0), "prototype", toValue(prototype))
self.define(_propertyMode(propertyModeWrite), "prototype", toValue(prototype))
prototype.define(
_propertyMode(propertyModeWrite | propertyModeConfigure),
"constructor", toValue(self),