Skip to content

Commit 599088e

Browse files
committed
Merge branch 'master' of https://github.com/AlexECX/Transcrypt
2 parents 3a3bdb3 + d356b86 commit 599088e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

transcrypt/modules/org/transcrypt/__core__.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ export var __def__ = function (cls, method, name) {
115115
});
116116
};
117117

118+
// Binds a function to the target class object
119+
export var __def__ = function (cls, method, name) {
120+
let method_name = (name ? name : method.name);
121+
Object.defineProperty (cls, method_name, {
122+
get: method, set: (func) => __def__ (this, func, method_name),
123+
configurable: true, enumerable: true
124+
});
125+
};
126+
118127
// Since we want to assign functions, a = b.f should make b.f produce a bound function
119128
// So __get__ should be called by a property rather then a function
120129
// Factory __get__ creates one of three curried functions for func

transcrypt/modules/re/translate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def translate(rgx):
314314
while True:
315315
nloop += 1
316316
if nloop > MAX_SHIFTREDUCE_LOOPS:
317-
raise Exception("Too many iterations in converting regex from Python to JavaScript")
317+
raise Exception()
318318

319319
stack, queue, flags, done = shiftReduce(stack, queue, namedGroups, flags)
320320
if done:

0 commit comments

Comments
 (0)