zitsky / tiny-js

Automatically exported from code.google.com/p/tiny-js
0 stars 0 forks source link

prototype on objects does not seem to work #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
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