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

prototype on objects does not seem to work #17

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 2 comments
Open

prototype on objects does not seem to work #17

GoogleCodeExporter opened this issue Mar 24, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Person = function(name,age)
{
this.name = name;
this.age = age;
}

Person.prototype.id = function(){ return this.name + " " + this.age;}

mike = new Person("mike",39);

print(mike.id());


What is the expected output? What do you see instead?

should be: "mike 39"

prints out: "undefined"

What version of the product are you using? On what operating system?

TinyJS on Win7

Please provide any additional information below.


Original issue reported on code.google.com by shalom.m...@gmail.com on 7 Nov 2014 at 12:16

@GoogleCodeExporter
Copy link
Author

Hi. Have you tried the 42tiny-js branch? That is a far more complete 
implementation of JavaScript now.

Original comment by pur3m...@googlemail.com on 7 Nov 2014 at 10:49

@GoogleCodeExporter
Copy link
Author

Hi, thanks for your reply !  This was on the 42tiny branch

Original comment by shalom.m...@gmail.com on 7 Nov 2014 at 3:11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant