aboutsummaryrefslogtreecommitdiff
path: root/src/embind/emval.js
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-01-21 18:54:47 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:23:18 +0300
commit2b173301eface816c6f09f3e3d706571575a398a (patch)
treeccaba39ee2c98000e3ba42bc5ae3e759a36984d2 /src/embind/emval.js
parente5a50ea590133df344bde9e1fda0f98afa755378 (diff)
Simplify emscripten::val a bit, reducing it closer to its primitive operations.
Diffstat (limited to 'src/embind/emval.js')
-rwxr-xr-xsrc/embind/emval.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/embind/emval.js b/src/embind/emval.js
index 1c4955c5..8ecef7f0 100755
--- a/src/embind/emval.js
+++ b/src/embind/emval.js
@@ -49,7 +49,11 @@ function __emval_new_object() {
return __emval_register({});
}
-function __emval_new_null() {
+function __emval_undefined() {
+ return __emval_register(undefined);
+}
+
+function __emval_null() {
return __emval_register(null);
}
@@ -63,9 +67,11 @@ function __emval_take_value(type, v) {
return __emval_register(v);
}
-function __emval_has_property(handle, k) {
- k = Pointer_stringify(k);
- return _emval_handle_array[handle].value.hasOwnProperty(k);
+var global = Function('return this')();
+
+function __emval_get_global(name) {
+ name = Pointer_stringify(name);
+ return __emval_register(global[name]);
}
function __emval_get_property(handle, k) {