mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[spidermonkey] URL
A few getters passed tests.
This commit is contained in:
parent
6b5ed8fa51
commit
f48cec877e
@ -41,6 +41,7 @@
|
||||
#include "ecmascript/spidermonkey/navigator.h"
|
||||
#include "ecmascript/spidermonkey/screen.h"
|
||||
#include "ecmascript/spidermonkey/unibar.h"
|
||||
#include "ecmascript/spidermonkey/url.h"
|
||||
#include "ecmascript/spidermonkey/window.h"
|
||||
#include "ecmascript/spidermonkey/xhr.h"
|
||||
#include "intl/libintl.h"
|
||||
@ -150,7 +151,7 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
|
||||
JSContext *ctx;
|
||||
JSObject *console_obj, *document_obj, /* *forms_obj,*/ *history_obj,
|
||||
*statusbar_obj, *menubar_obj, *navigator_obj, *localstorage_obj, *screen_obj,
|
||||
*xhr_obj, *event_obj, *keyboardEvent_obj, *messageEvent_obj, *customEvent_obj;
|
||||
*xhr_obj, *event_obj, *keyboardEvent_obj, *messageEvent_obj, *customEvent_obj, *url_obj;
|
||||
|
||||
assert(interpreter);
|
||||
if (!js_module_init_ok) return NULL;
|
||||
@ -328,6 +329,17 @@ spidermonkey_get_interpreter(struct ecmascript_interpreter *interpreter)
|
||||
if (!customEvent_obj) {
|
||||
goto release_and_fail;
|
||||
}
|
||||
|
||||
url_obj = spidermonkey_InitClass(ctx, global, NULL,
|
||||
&url_class, url_constructor, 0,
|
||||
url_props,
|
||||
url_funcs,
|
||||
NULL, NULL, "URL");
|
||||
|
||||
if (!url_obj) {
|
||||
goto release_and_fail;
|
||||
}
|
||||
|
||||
JS::SetRealmPrivate(js::GetContextRealm(ctx), interpreter);
|
||||
|
||||
return ctx;
|
||||
|
@ -3,6 +3,6 @@ include $(top_builddir)/Makefile.config
|
||||
INCLUDES += $(SPIDERMONKEY_CFLAGS)
|
||||
|
||||
OBJS = attr.obj attributes.obj collection.obj console.obj css.obj customevent.obj document.obj element.obj event.obj form.obj forms.obj heartbeat.obj history.obj implementation.obj input.obj \
|
||||
keyboard.obj localstorage.obj location.obj message.obj navigator.obj nodelist.obj screen.obj style.obj unibar.obj window.obj xhr.obj
|
||||
keyboard.obj localstorage.obj location.obj message.obj navigator.obj nodelist.obj screen.obj style.obj unibar.obj url.obj window.obj xhr.obj
|
||||
|
||||
include $(top_srcdir)/Makefile.lib
|
||||
|
@ -1,3 +1,3 @@
|
||||
srcs += files('attr.cpp', 'attributes.cpp', 'collection.cpp', 'console.cpp', 'css.cpp', 'customevent.cpp', 'document.cpp', 'element.cpp', 'event.cpp',
|
||||
'form.cpp', 'forms.cpp', 'heartbeat.cpp', 'history.cpp', 'implementation.cpp', 'input.cpp', 'keyboard.cpp',
|
||||
'localstorage.cpp', 'location.cpp', 'message.cpp', 'navigator.cpp', 'nodelist.cpp', 'screen.cpp', 'style.cpp', 'unibar.cpp', 'window.cpp', 'xhr.cpp')
|
||||
'localstorage.cpp', 'location.cpp', 'message.cpp', 'navigator.cpp', 'nodelist.cpp', 'screen.cpp', 'style.cpp', 'unibar.cpp', 'url.cpp', 'window.cpp', 'xhr.cpp')
|
||||
|
1026
src/ecmascript/spidermonkey/url.cpp
Normal file
1026
src/ecmascript/spidermonkey/url.cpp
Normal file
File diff suppressed because it is too large
Load Diff
11
src/ecmascript/spidermonkey/url.h
Normal file
11
src/ecmascript/spidermonkey/url.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef EL__ECMASCRIPT_SPIDERMONKEY_URL_H
|
||||
#define EL__ECMASCRIPT_SPIDERMONKEY_URL_H
|
||||
|
||||
#include "ecmascript/spidermonkey/util.h"
|
||||
|
||||
extern JSClass url_class;
|
||||
extern JSPropertySpec url_props[];
|
||||
extern const spidermonkeyFunctionSpec url_funcs[];
|
||||
bool url_constructor(JSContext* ctx, unsigned argc, JS::Value* vp);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user