Closed GoogleCodeExporter closed 9 years ago
the part that says this.wtf is not this.wtf... I just copy/pasted part of the
log from different parts.
Original comment by heynem...@gmail.com
on 6 Dec 2012 at 6:10
Original comment by flier...@gmail.com
on 26 Dec 2012 at 7:28
The major problem is PyV8 doesn't support to create JS object with constructor,
please verify the fix with SVN trunk code after r470.
def testConstructor(self):
with JSContext() as ctx:
ctx.eval("""
var Test = function() {
this.trySomething();
};
Test.prototype.trySomething = function() {
this.name = 'flier';
};
var Test2 = function(first_name, last_name) {
this.name = first_name + ' ' + last_name;
};
""")
self.assert_(isinstance(ctx.locals.Test, _PyV8.JSFunction))
test = JSObject.create(ctx.locals.Test)
self.assert_(isinstance(ctx.locals.Test, _PyV8.JSObject))
self.assertEquals("flier", test.name);
test2 = JSObject.create(ctx.locals.Test2, ('Flier', 'Lu'))
self.assertEquals("Flier Lu", test2.name);
test3 = JSObject.create(ctx.locals.Test2, ('Flier', 'Lu'), { 'email': 'flier.lu@gmail.com' })
self.assertEquals("flier.lu@gmail.com", test3.email);
Original comment by flier...@gmail.com
on 15 Jan 2013 at 9:42
Original issue reported on code.google.com by
heynem...@gmail.com
on 6 Dec 2012 at 5:56