Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
f5140c8a
Commit
f5140c8a
authored
Mar 13, 2019
by
Michael Droettboom
Committed by
GitHub
Mar 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #333 from mdboom/fix-apply-on-pyproxy
Fix #332: Make pyproxy.apply work
parents
584c61ed
1b111df2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/pyproxy.c
src/pyproxy.c
+14
-3
No files found.
src/pyproxy.c
View file @
f5140c8a
...
...
@@ -157,6 +157,7 @@ EM_JS(int, pyproxy_init, (), {
return
result
;
},
get:
function
(
jsobj
,
jskey
)
{
ptrobj
=
this
.
getPtr
(
jsobj
);
if
(
jskey
===
'
toString
'
)
{
return
function
()
{
if
(
self
.
pyodide
.
repr
===
undefined
)
{
...
...
@@ -167,10 +168,20 @@ EM_JS(int, pyproxy_init, (), {
}
else
if
(
jskey
===
'$$'
)
{
return
jsobj
[
'$$'
];
}
else
if
(
jskey
===
'
destroy
'
)
{
__pyproxy_destroy
(
this
.
getPtr
(
jsobj
));
jsobj
[
'$$'
][
'
ptr
'
]
=
null
;
return
function
()
{
__pyproxy_destroy
(
ptrobj
);
jsobj
[
'$$'
][
'
ptr
'
]
=
null
;
}
}
else
if
(
jskey
==
'
apply
'
)
{
return
function
(
jsthis
,
jsargs
)
{
var
idargs
=
Module
.
hiwire_new_value
(
jsargs
);
var
idresult
=
__pyproxy_apply
(
ptrobj
,
idargs
);
var
jsresult
=
Module
.
hiwire_get_value
(
idresult
);
Module
.
hiwire_decref
(
idresult
);
Module
.
hiwire_decref
(
idargs
);
return
jsresult
;
};
}
ptrobj
=
this
.
getPtr
(
jsobj
);
var
idkey
=
Module
.
hiwire_new_value
(
jskey
);
var
idresult
=
__pyproxy_get
(
ptrobj
,
idkey
);
var
jsresult
=
Module
.
hiwire_get_value
(
idresult
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment