File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 1414require ("base64" )
1515require ("timers" )
1616require ("url" )
17- require ("XMLHttpRequest" )
18-
19- # Add the `.keys()` method on `Object.prototype` to get JSObjectProxy dict() conversion working
20- # Conversion from a dict-subclass to a strict dict by `dict(subclass)` internally calls the .keys() method to read the dictionary keys,
21- # but .keys on a JSObjectProxy can only come from the JS side
22- pythonmonkey .eval ("""
23- (makeList) => {
24- const keysMethod = {
25- get() {
26- return () => makeList(...Object.keys(this))
27- }
28- }
29- Object.defineProperty(Object.prototype, "keys", keysMethod)
30- Object.defineProperty(Array.prototype, "keys", keysMethod)
31- }
32- """ , { 'filename' : __file__ , 'fromPythonFrame' : True })(lambda * args : list (args ))
17+ require ("XMLHttpRequest" )
You can’t perform that action at this time.
0 commit comments