Skip to content

Commit 0cc74ae

Browse files
authored
[embind] Fix closure with assertions enabled. (#22760)
`argPackAdvance` was being minified so the check for the property was not working when assertions were enabled with closure. Fixes #22759
1 parent 5eb1305 commit 0cc74ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/embind/embind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ var LibraryEmbind = {
266266
$registerType__docs: '/** @param {Object=} options */',
267267
$registerType: function(rawType, registeredInstance, options = {}) {
268268
#if ASSERTIONS
269-
if (!('argPackAdvance' in registeredInstance)) {
269+
if (registeredInstance.argPackAdvance === undefined) {
270270
throw new TypeError('registerType registeredInstance requires argPackAdvance');
271271
}
272272
#endif

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3234,7 +3234,7 @@ def test_embind_closure_no_dynamic_execution(self):
32343234
'o1': ['-O1'],
32353235
'o2': ['-O2'],
32363236
'o2_mem_growth': ['-O2', '-sALLOW_MEMORY_GROWTH', test_file('embind/isMemoryGrowthEnabled=true.cpp')],
3237-
'o2_closure': ['-O2', '--closure=1', '--closure-args', '--externs ' + shlex.quote(test_file('embind/underscore-externs.js'))],
3237+
'o2_closure': ['-O2', '--closure=1', '--closure-args', '--externs ' + shlex.quote(test_file('embind/underscore-externs.js')), '-sASSERTIONS=1'],
32383238
'strict_js': ['-sSTRICT_JS']
32393239
})
32403240
def test_embind(self, *extra_args):

0 commit comments

Comments
 (0)