Skip to content

Commit

Permalink
Modify bindings to automatically remove Array proto fills
Browse files Browse the repository at this point in the history
  • Loading branch information
jawline committed Feb 9, 2016
1 parent 773c7a3 commit c1d8c64
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
Binary file modified compiled/z3.emscripten.js.mem
Binary file not shown.
8 changes: 7 additions & 1 deletion compiled/z3_bindings_em.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"use strict";

//Remove fill on Array as it causes emscripten to crash (Re added at bottom of file)
var findProto = Array.prototype.find;
delete Array.prototype.find;

import Module from './z3.emscripten.js';

// Manually defined types (from Z3 Python API). Could possibly be simplified to just Voidp
Expand Down Expand Up @@ -64,7 +68,9 @@ var ref = {
refType: function() {
return 'number';
}
};
};

Array.prototype.find = findProto;

var GeneratedBindings = [];

Expand Down
7 changes: 7 additions & 0 deletions compiled/z3_bindings_em_es5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

//Remove fill on Array as it causes emscripten to crash (Re added at bottom of file)

Object.defineProperty(exports, "__esModule", {
value: true
});
Expand All @@ -10,6 +12,9 @@ var _z3Emscripten2 = _interopRequireDefault(_z3Emscripten);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var findProto = Array.prototype.find;
delete Array.prototype.find;

// Manually defined types (from Z3 Python API). Could possibly be simplified to just Voidp
// but maybe we'll need the distinction later
var Void = null,
Expand Down Expand Up @@ -74,6 +79,8 @@ var ref = {
}
};

Array.prototype.find = findProto;

var GeneratedBindings = [];

GeneratedBindings['Z3_global_param_set'] = [Void, [CString, CString]];
Expand Down
8 changes: 7 additions & 1 deletion templates/pre_em_bindings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"use strict";

//Remove fill on Array as it causes emscripten to crash (Re added at bottom of file)
var findProto = Array.prototype.find;
delete Array.prototype.find;

import Module from './z3.emscripten.js';

// Manually defined types (from Z3 Python API). Could possibly be simplified to just Voidp
Expand Down Expand Up @@ -64,4 +68,6 @@ var ref = {
refType: function() {
return 'number';
}
};
};

Array.prototype.find = findProto;

0 comments on commit c1d8c64

Please sign in to comment.