aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-04-16 02:13:41 -0700
committerJukka Jylänki <jujjyl@gmail.com>2013-04-18 20:08:17 +0300
commitd990cb17d8c43913a733c28601f4319fce90c27a (patch)
tree1f390315942770b08df008899032d053ccd58f67 /system
parentc2bc8d4f1ed4fe5e7477e4dc5d3f32ca5f1e6a56 (diff)
Finally! JSInterface is dead
Diffstat (limited to 'system')
-rwxr-xr-xsystem/include/emscripten/bind.h74
-rwxr-xr-xsystem/lib/embind/bind.cpp8
2 files changed, 0 insertions, 82 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index b17488b9..894586a6 100755
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -1249,80 +1249,6 @@ namespace emscripten {
typename std::aligned_storage<sizeof(T)>::type data;
};
}
-
- ////////////////////////////////////////////////////////////////////////////////
- // NEW INTERFACE
- ////////////////////////////////////////////////////////////////////////////////
-
- class JSInterface {
- public:
- JSInterface(internal::EM_VAL handle) {
- initialize(handle);
- }
-
- JSInterface(const JSInterface& obj)
- : jsobj(obj.jsobj)
- {}
-
- template<typename ReturnType, typename... Args>
- ReturnType call(const char* name, Args... args) {
- assertInitialized();
- return Caller<ReturnType, Args...>::call(*jsobj, name, args...);
- }
-
- static std::shared_ptr<JSInterface> cloneToSharedPtr(const JSInterface& i) {
- return std::make_shared<JSInterface>(i);
- }
-
- private:
- void initialize(internal::EM_VAL handle) {
- if (jsobj) {
- internal::_embind_fatal_error(
- "Cannot initialize interface wrapper twice",
- "JSInterface");
- }
- jsobj = val::take_ownership(handle);
- }
-
- // this class only exists because you can't partially specialize function templates
- template<typename ReturnType, typename... Args>
- struct Caller {
- static ReturnType call(val& v, const char* name, Args... args) {
- return v.call(name, args...).template as<ReturnType>();
- }
- };
-
- template<typename... Args>
- struct Caller<void, Args...> {
- static void call(val& v, const char* name, Args... args) {
- v.call_void(name, args...);
- }
- };
-
- void assertInitialized() {
- if (!jsobj) {
- internal::_embind_fatal_error(
- "Cannot invoke call on uninitialized Javascript interface wrapper.", "JSInterface");
- }
- }
-
- internal::optional<val> jsobj;
- };
-
- namespace internal {
- extern JSInterface* create_js_interface(EM_VAL e);
- }
-
- class register_js_interface {
- public:
- register_js_interface() {
- _embind_register_interface(
- internal::TypeID<JSInterface>::get(),
- "JSInterface",
- reinterpret_cast<internal::GenericFunction>(&internal::create_js_interface),
- reinterpret_cast<internal::GenericFunction>(&internal::raw_destructor<JSInterface>));
- }
- };
}
namespace emscripten {
diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp
index 6cacf1e2..35d99dad 100755
--- a/system/lib/embind/bind.cpp
+++ b/system/lib/embind/bind.cpp
@@ -36,14 +36,6 @@ extern "C" {
}
}
-namespace emscripten {
- namespace internal {
- JSInterface* create_js_interface(EM_VAL e) {
- return new JSInterface(e);
- }
- }
-}
-
// TODO: fix in library.js or a proper emscripten libc
extern "C" wchar_t *wmemset(wchar_t *dest, wchar_t c, size_t count) {
wchar_t *o = dest;