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

Prototypal inheritence not working in all instances. #3

Closed
AntiMS opened this issue Oct 16, 2012 · 2 comments
Closed

Prototypal inheritence not working in all instances. #3

AntiMS opened this issue Oct 16, 2012 · 2 comments

Comments

@AntiMS
Copy link

AntiMS commented Oct 16, 2012

I've got another for you.

Prototypal inheritence seems not to work properly. Following is the most minimal test case I can think of.

Steps to reproduce:
echo "var a = {'a': 'a'}; function F(){} F.prototype = a; console.log((new F()).a);" | otto

Expected result:
Prints a single "a" followed by a newline to the console and exits.

Actual result:
Prints "undefined" followed by a newline to the console and exits.

Thanks much! Sorry to be the complainer that points out all of your mistakes. ;)

@robertkrimen
Copy link
Owner

The configuration for the prototype property was inadvertently being initialized to read-only, rather than write-only:

-      self.define(_propertyMode(0), "prototype", toValue(prototype))
+      self.define(_propertyMode(propertyModeWrite), "prototype", toValue(prototype))

@robertkrimen
Copy link
Owner

Thanks, for the report. I do appreciate them; they help make the project better.

I recently discovered: http://test262.ecmascript.org

I'm going to give those a shot when I have a chance.

deoxxa pushed a commit to deoxxa/otto that referenced this issue Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants