summaryrefslogtreecommitdiff
path: root/api/dwb-js.7
diff options
context:
space:
mode:
authorportix <none@none>2012-12-05 14:48:53 +0100
committerportix <none@none>2012-12-05 14:48:53 +0100
commitdbeec3f7a8b6cdf6a080d24aa4297422fe3d70cb (patch)
treebf18e9bf339ba53a4d5809f579c10a907bad8b19 /api/dwb-js.7
parent86194c6f8f633b2ea74572eb15719ed2c801f085 (diff)
downloaddwb-dbeec3f7a8b6cdf6a080d24aa4297422fe3d70cb.zip
Call JSValueMakeNull and JSValueMakeUndefined only once, updated jsapi
Diffstat (limited to 'api/dwb-js.7')
-rw-r--r--api/dwb-js.731
1 files changed, 27 insertions, 4 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7
index c4d03bfd..1c3e07ac 100644
--- a/api/dwb-js.7
+++ b/api/dwb-js.7
@@ -2,12 +2,12 @@
.\" Title: dwb-js
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
-.\" Date: 12/04/2012
+.\" Date: 12/05/2012
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DWB\-JS" "7" "12/04/2012" "\ \&" "\ \&"
+.TH "DWB\-JS" "7" "12/05/2012" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -84,8 +84,6 @@ In contrast to the global window object in the web execution context, the global
for details\&.
.RE
.SH "GLOBAL"
-.sp
-Methods from the global object\&.
.SS "Methods"
.sp
.it 1 an-trap
@@ -212,6 +210,31 @@ var p = i\&.getPrivate(); // 37
.if n \{\
.RE
.\}
+.sp
+or define a module that can be shared:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+// included script
+
+var private = 37;
+provide("foo", {
+ getPrivate : function() {
+ return private;
+ }
+});
+
+// Scripts that includes the above
+var i = include("/path/to/script");
+require(["foo"], function(foo) {
+ var bar = foo\&.getPrivate(); // 37
+})
+.fi
+.if n \{\
+.RE
+.\}
.RE
.sp
.it 1 an-trap