shithub: libmujs

Download patch

ref: 0bb8f448b325722a804566b0557824f3a7ec2fcd
parent: fa3d30fd18c348bb4b1f3858fb860f4fcd4b2045
author: Tor Andersson <[email protected]>
date: Fri Jan 13 11:13:19 EST 2017

Update docs.

--- a/docs/examples.html
+++ b/docs/examples.html
@@ -41,7 +41,7 @@
 {
 	js_State *J = js_newstate(NULL, NULL, JS_STRICT);
 
-	js_newcfunction(J, hello, 1);
+	js_newcfunction(J, hello, "hello", 1);
 	js_setglobal(J, "hello");
 
 	js_dostring(J, "hello('world');");
@@ -155,16 +155,16 @@
 	js_getproperty(J, -1, "prototype");	// File.prototype.[[Prototype]] = Object.prototype
 	js_newuserdata(J, TAG, stdin);		// File.prototype.[[Userdata]] = stdin
 	{
-		js_newcfunction(J, File_prototype_readByte, 0);
+		js_newcfunction(J, File_prototype_readByte, "File.prototype.readByte", 0);
 		js_defproperty(J, -2, "readByte", JS_DONTENUM);
 
-		js_newcfunction(J, File_prototype_readLine, 0);
+		js_newcfunction(J, File_prototype_readLine, "File.prototype.readLine", 0);
 		js_defproperty(J, -2, "readLine", JS_DONTENUM);
 
-		js_newcfunction(J, File_prototype_close, 0);
+		js_newcfunction(J, File_prototype_close, "File.prototype.close", 0);
 		js_defproperty(J, -2, "close", JS_DONTENUM);
 	}
-	js_newcconstructor(J, new_File, new_File, 1);
+	js_newcconstructor(J, new_File, new_File, "File", 1);
 	js_defglobal(J, "File", JS_DONTENUM);
 }
 </pre>
--- a/docs/reference.html
+++ b/docs/reference.html
@@ -146,7 +146,7 @@
 The interpreter uses a host provided function for all memory allocation needs:
 
 <pre>
-typedef void *(*js_Alloc)(void *memctx, void *ptr, unsigned int size);
+typedef void *(*js_Alloc)(void *memctx, void *ptr, int size);
 </pre>
 
 <p>
@@ -504,8 +504,8 @@
 <h3>Array properties</h3>
 
 <pre>
-unsigned int js_getlength(js_State *J, int idx);
-void js_setlength(js_State *J, int idx, unsigned int len);
+int js_getlength(js_State *J, int idx);
+void js_setlength(js_State *J, int idx, int len);
 </pre>
 
 <p>
@@ -512,10 +512,10 @@
 Wrappers to get and set the "length" property of an object.
 
 <pre>
-int js_hasindex(js_State *J, int idx, unsigned int i);
-void js_getindex(js_State *J, int idx, unsigned int i);
-void js_setindex(js_State *J, int idx, unsigned int i);
-void js_delindex(js_State *J, int idx, unsigned int i);
+int js_hasindex(js_State *J, int idx, int i);
+void js_getindex(js_State *J, int idx, int i);
+void js_setindex(js_State *J, int idx, int i);
+void js_delindex(js_State *J, int idx, int i);
 </pre>
 
 <p>
@@ -543,7 +543,7 @@
 <h3>C Functions</h3>
 
 <pre>
-void js_newcfunction(js_State *J, js_CFunction fun, unsigned int length);
+void js_newcfunction(js_State *J, js_CFunction fun, const char *name, int length);
 </pre>
 
 <p>
@@ -555,7 +555,8 @@
 
 <pre>
 void js_newcconstructor(js_State *J,
-	js_CFunction fun, js_CFunction con, unsigned int length);
+	js_CFunction fun, js_CFunction con,
+	const char *name, int length);
 </pre>
 
 <p>