aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-01-22 15:58:17 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:23:25 +0300
commit066540930e679a965fa002cb09b3e6cc3bcc2c97 (patch)
tree9a5d788c9593dc81e3408e07e75289e9dc3dc209
parent661e70cb38bbdd704821c50c4324b5675b41068c (diff)
Switch from val::get to val[]
-rwxr-xr-xsystem/include/emscripten/bind.h4
-rw-r--r--system/include/emscripten/val.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 652fb1b4..ce9053f2 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -793,11 +793,11 @@ namespace emscripten {
////////////////////////////////////////////////////////////////////////////////
template<typename T>
std::vector<T> vecFromJSArray(val v) {
- auto l = v.get("length").as<unsigned>();
+ auto l = v["length"].as<unsigned>();
std::vector<T> rv;
for(unsigned i = 0; i < l; ++i) {
- rv.push_back(v.get(i).as<T>());
+ rv.push_back(v[i].as<T>());
}
return rv;
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h
index 4903751b..87126d08 100644
--- a/system/include/emscripten/val.h
+++ b/system/include/emscripten/val.h
@@ -105,7 +105,7 @@ namespace emscripten {
}
template<typename T>
- val get(const T& key) const {
+ val operator[](const T& key) const {
return val(internal::_emval_get_property(handle, val(key).handle));
}