aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChad Austin <caustin@gmail.com>2014-03-24 00:54:18 -0700
committerChad Austin <chad@chadaustin.me>2014-03-28 23:56:41 -0700
commitfa3e4f460a86ee2e0212fe2471690f67b9b4280c (patch)
tree8f29ee37885f8249bd9bea84bf5dadc5acf99048 /tests
parentbcb2da768ab5b559b1603b28e3f7b1a3e1b0b6fc (diff)
Make val::call<> compatible with asm.js
Diffstat (limited to 'tests')
-rw-r--r--tests/embind/embind.test.js13
-rw-r--r--tests/embind/embind_test.cpp6
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index 4ac8fe52..e2160c33 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -1997,6 +1997,19 @@ module({
assert.equal(10, instance.view.byteLength);
assert.equal("after", instance.after);
});
+
+ test("ints_and_float", function() {
+ function factory(a, b, c) {
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+ var instance = cm.construct_with_ints_and_float(factory);
+ assert.equal(65537, instance.a);
+ assert.equal(4.0, instance.b);
+ assert.equal(65538, instance.c);
+ });
});
});
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 0b3f67e9..d299660a 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -2351,7 +2351,13 @@ val construct_with_memory_view(val factory) {
std::string("after"));
}
+val construct_with_ints_and_float(val factory) {
+ static const char data[11] = "0123456789";
+ return factory.new_(65537, 4.0f, 65538);
+}
+
EMSCRIPTEN_BINDINGS(val_new_) {
function("construct_with_6_arguments", &construct_with_6);
function("construct_with_memory_view", &construct_with_memory_view);
+ function("construct_with_ints_and_float", &construct_with_ints_and_float);
}