diff options
author | Chad Austin <chad@imvu.com> | 2014-03-31 22:43:28 -0700 |
---|---|---|
committer | Chad Austin <chad@chadaustin.me> | 2014-04-13 09:08:27 -0700 |
commit | 2bbdb0cd396d785a9587bc776d699283c1902ff7 (patch) | |
tree | 7660e0be1523660cf21bd252af16f9bd605bcd9a /tests | |
parent | ce58885c11947bc4fb511646989c7d88212f69fa (diff) |
embind doesn't always need the full std::type_info record. if EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0, then use a lighter type identifier. This shaves 175 KB off of our engine's minified JavaScript.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/embind/embind.test.js | 4 | ||||
-rw-r--r-- | tests/embind/embind_test.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index e2160c33..4b10a6c6 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -1646,6 +1646,10 @@ module({ if (typeof INVOKED_FROM_EMSCRIPTEN_TEST_RUNNER === "undefined") { // TODO: Enable this to work in Emscripten runner as well! BaseFixture.extend("unbound types", function() { + if (!cm.hasUnboundTypeNames) { + return; + } + function assertMessage(fn, message) { var e = assert.throws(cm.UnboundTypeError, fn); assert.equal(message, e.message); diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index d299660a..b0c68f75 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -2147,6 +2147,8 @@ struct BoundClass { }; EMSCRIPTEN_BINDINGS(incomplete) { + constant("hasUnboundTypeNames", emscripten::has_unbound_type_names); + function("getUnboundClass", &passThrough<UnboundClass>); class_<HasUnboundBase, base<UnboundClass>>("HasUnboundBase") |