aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsystem/include/emscripten/bind.h12
-rw-r--r--system/include/emscripten/val.h13
2 files changed, 13 insertions, 12 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 99b29e9c..7a87107f 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -729,18 +729,6 @@ namespace emscripten {
// VECTORS
////////////////////////////////////////////////////////////////////////////////
template<typename T>
- std::vector<T> vecFromJSArray(val v) {
- auto l = v["length"].as<unsigned>();
-
- std::vector<T> rv;
- for(unsigned i = 0; i < l; ++i) {
- rv.push_back(v[i].as<T>());
- }
-
- return rv;
- };
-
- template<typename T>
class_<std::vector<T>> register_vector(const char* name) {
using namespace std;
typedef vector<T> VecType;
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h
index 857a1bdf..3952e008 100644
--- a/system/include/emscripten/val.h
+++ b/system/include/emscripten/val.h
@@ -2,6 +2,7 @@
#include <stdint.h> // uintptr_t
#include <emscripten/wire.h>
+#include <vector>
namespace emscripten {
namespace internal {
@@ -237,4 +238,16 @@ namespace emscripten {
}
};
}
+
+ template<typename T>
+ std::vector<T> vecFromJSArray(val v) {
+ auto l = v["length"].as<unsigned>();
+
+ std::vector<T> rv;
+ for(unsigned i = 0; i < l; ++i) {
+ rv.push_back(v[i].as<T>());
+ }
+
+ return rv;
+ };
}