summaryrefslogtreecommitdiff
path: root/tests/embind/embind_test.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-18 11:40:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-18 11:40:05 -0700
commitf0dd2f8d2da50da0ab87f5e2585e59e7a5f521b7 (patch)
tree6c22b5ac383495f5c61a2175d50a10f9a63e4c95 /tests/embind/embind_test.cpp
parent57360800512dc1b23532e1c125c8e0627ccdbcfa (diff)
parentb41adadcf60a25c14f4b139d0ee664521f76a620 (diff)
Merge pull request #2360 from chadaustin/expose-val-typeof
expose typeof via emscripten::val
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r--tests/embind/embind_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 5a83903a..52103bbb 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -2368,3 +2368,11 @@ EMSCRIPTEN_BINDINGS(val_new_) {
function("construct_with_memory_view", &construct_with_memory_view);
function("construct_with_ints_and_float", &construct_with_ints_and_float);
}
+
+std::string getTypeOfVal(const val& v) {
+ return v.typeof().as<std::string>();
+}
+
+EMSCRIPTEN_BINDINGS(typeof) {
+ function("getTypeOfVal", &getTypeOfVal);
+}