Browse Source

can't extend custom classes injected from C

sisyphus
Dustin Falgout 8 years ago
parent
commit
1cf04bae81
  1. 7
      src/gresource/js/ThemeUtils.js
  2. 13
      src/webkit2-extension.c

7
src/gresource/js/ThemeUtils.js

@ -30,7 +30,7 @@
/**
* Provides various utility methods and can be used by greeter themes if needed.
*/
class ThemeUtils extends __ThemeUtils {
class ThemeUtils {
/**
* Binds `this` to class, `context`, for all of the class's methods.
*
@ -38,7 +38,7 @@ class ThemeUtils extends __ThemeUtils {
*
* @return {function(new:*): Object} `context` with `this` bound to it for all of its methods.
*/
bind_this( context ) {
static bind_this( context ) {
let excluded_methods = ['constructor'];
function not_excluded( _method, _context ) {
@ -63,7 +63,8 @@ class ThemeUtils extends __ThemeUtils {
}
}
window.theme_utils = new ThemeUtils();
window.theme_utils = new __ThemeUtils();
window.theme_utils.bind_this = ThemeUtils.bind_this;
/* -------->>> DEPRECATED! <<<-------- */
window.greeterutil = window.theme_utils;

13
src/webkit2-extension.c

@ -1561,12 +1561,12 @@ static const JSClassDefinition config_file_definition = {
};
static const JSClassDefinition theme_utils_definition = {
0, /* Version */
kJSClassAttributeNone, /* Attributes */
"__ThemeUtils", /* Class name */
NULL, /* Parent class */
NULL, /* Static values */
theme_utils_functions, /* Static functions */
0, /* Version */
kJSClassAttributeNoAutomaticPrototype, /* Attributes */
"__ThemeUtils", /* Class name */
NULL, /* Parent class */
NULL, /* Static values */
theme_utils_functions, /* Static functions */
};
@ -1580,7 +1580,6 @@ window_object_cleared_callback(WebKitScriptWorld *world,
WebKitDOMDOMWindow *dom_window;
WebKitDOMDocument *dom_document;
JSStringRef command;
JSObjectRef gettext_object,
lightdm_greeter_object,
config_file_object,

Loading…
Cancel
Save