summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-03 18:28:48 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-11-03 18:28:48 +0000
commit6648ba39ade5ed8c1a5ceccab82eed567478c950 (patch)
tree6656dc55f3af76a918185e7a9625257a27abdac6
parente7431898abbcb4cc49cfbe35fe457df78afa5f0a (diff)
parent85c973f98648465ab065317f8e7db6153d093984 (diff)
downloadnetsurf-6648ba39ade5ed8c1a5ceccab82eed567478c950.tar.gz
netsurf-6648ba39ade5ed8c1a5ceccab82eed567478c950.tar.bz2
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
-rw-r--r--cocoa/Makefile.target6
-rw-r--r--javascript/jsapi.h4
-rw-r--r--test/js/dom-location.html13
3 files changed, 22 insertions, 1 deletions
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
index 82900b6b0..fa1f7a095 100644
--- a/cocoa/Makefile.target
+++ b/cocoa/Makefile.target
@@ -146,7 +146,7 @@ R_RESOURCES := default.css adblock.css internal.css quirks.css NetSurf.icns Home
R_RESOURCES := $(addprefix cocoa/res/,$(R_RESOURCES))
LANGUAGES := de en fr it nl
-LOCALIZED_RESOURCES := Messages Localizable.strings
+LOCALIZED_RESOURCES := Localizable.strings
TABBAR_RESOURCES := AquaTabClose_Front_Pressed.png \
AquaTabClose_Front_Rollover.png \
@@ -163,12 +163,16 @@ TABBAR_RESOURCES := AquaTabClose_Front_Pressed.png \
R_RESOURCES += $(addprefix cocoa/PSMTabBarControl/Images/,$(TABBAR_RESOURCES))
+#languiage project macro
+# $1 is language name
+# $2 is list of resources per language
define make_lproj
R_RESOURCES += $$(OBJROOT)/$(1).lproj
$$(OBJROOT)/$(1).lproj: $(2)
$(VQ)echo Bundling language $(1)
$(Q)mkdir -p $$@
$(Q)cp -pLR $(2) $$@
+ $(Q)$(PERL) utils/split-messages.pl $(1) cocoa < resources/FatMessages > $$@/Messages
endef
# compile_xib (xib) (lang)
diff --git a/javascript/jsapi.h b/javascript/jsapi.h
index e7c10c139..61baa5ce1 100644
--- a/javascript/jsapi.h
+++ b/javascript/jsapi.h
@@ -94,6 +94,8 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
outchar = JS_GetStringBytes(injsstring); \
outlen = strlen(outchar)
+/* string type cast */
+#define JSAPI_STRING_TO_JSVAL(str) ((str == NULL)?JSVAL_NULL:STRING_TO_JSVAL(str))
#else /* #if JS_VERSION <= 180 */
@@ -152,6 +154,8 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
JS_EncodeStringToBuffer(injsstring, outchar, outlen); \
outchar[outlen] = '\0'
+/* string type cast */
+#define JSAPI_STRING_TO_JSVAL(str) ((str == NULL)?JSVAL_NULL:STRING_TO_JSVAL(str))
#endif
diff --git a/test/js/dom-location.html b/test/js/dom-location.html
new file mode 100644
index 000000000..bbd78d80b
--- /dev/null
+++ b/test/js/dom-location.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>Assign window.lately</title>
+<link rel="stylesheet" type="text/css" href="tst.css">
+</head>
+<body>
+<h1>Assign window.lately</h1>
+<p>location: <script>document.write(location);</script>
+<p>location.protocol: <script>document.write(location.protocol);</script>
+<p>equivalence <script>document.write(location.protocol === 'http:');</script>
+<p>assignement<script>window.lately = (location.protocol === 'http:');</script>
+</body>
+</html>