You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def foo():
class Bar:
def __init__(self, name):
self.name = name
b = Bar('foo')
print("b.name =", b.name)
foo()
Generated Javascript
var foo = function () {
var Bar = __class__ ('Bar', [object], {
get __init__ () {return __get__ (this, function (self, name) {
self.name = name;
});}
});
var b = Bar ('foo');
print ('b.name =', b.name);
};
I've added a default alias for identifier 'name' in the newest version that I am about to upload, this will now translate to:
var foo = function () {
var Bar = __class__ ('Bar', [object], {
get __init__ () {return __get__ (this, function (self, py_name) {
self.py_name = py_name;
});}
});
var b = Bar ('foo');
print ('b.name =', b.py_name);
};
Python
Generated Javascript
Causes
TypeError: "name" is read-only
I've not looked at the fix, but this seems similar to https://github.com/JdeH/Transcrypt/issues/24
The text was updated successfully, but these errors were encountered: