From 2bbdb0cd396d785a9587bc776d699283c1902ff7 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Mon, 31 Mar 2014 22:43:28 -0700 Subject: 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. --- tests/embind/embind.test.js | 4 ++++ tests/embind/embind_test.cpp | 2 ++ 2 files changed, 6 insertions(+) (limited to 'tests') 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); class_>("HasUnboundBase") -- cgit v1.2.3-70-g09d2