shithub: libmujs

Download patch

ref: e65764ecf9cb58621d78d9ac378008d076016e1b
parent: d35cef7df90196d56b9cf8ef8280f5af4e4a8dce
author: Tor Andersson <tor@ccxvii.net>
date: Thu Feb 6 09:44:33 EST 2014

Rename DontDelete flag to DontConf.

--- a/js.h
+++ b/js.h
@@ -53,7 +53,7 @@
 enum {
 	JS_READONLY = 1,
 	JS_DONTENUM = 2,
-	JS_DONTDELETE = 4,
+	JS_DONTCONF = 4,
 };
 
 void js_newerror(js_State *J, const char *message);
--- a/jsbuiltin.c
+++ b/jsbuiltin.c
@@ -101,13 +101,13 @@
 
 	/* Initialize the global object */
 	js_pushnumber(J, NAN);
-	js_defglobal(J, "NaN", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+	js_defglobal(J, "NaN", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 
 	js_pushnumber(J, INFINITY);
-	js_defglobal(J, "Infinity", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+	js_defglobal(J, "Infinity", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 
 	js_pushundefined(J);
-	js_defglobal(J, "undefined", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+	js_defglobal(J, "undefined", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 
 	jsB_globalf(J, "eval", jsB_eval, 1);
 	jsB_globalf(J, "parseInt", jsB_parseInt, 1);
--- a/jsrun.c
+++ b/jsrun.c
@@ -484,9 +484,9 @@
 	ref = jsV_setproperty(J, obj, name);
 	if (value && !(ref->atts & JS_READONLY))
 		ref->value = *value;
-	if (getter && !(ref->atts & JS_DONTDELETE))
+	if (getter && !(ref->atts & JS_DONTCONF))
 		ref->getter = getter;
-	if (setter && !(ref->atts & JS_DONTDELETE))
+	if (setter && !(ref->atts & JS_DONTCONF))
 		ref->setter = setter;
 	ref->atts |= atts;
 }
@@ -510,7 +510,7 @@
 
 	ref = jsV_getownproperty(J, obj, name);
 	if (ref) {
-		if (ref->atts & JS_DONTDELETE)
+		if (ref->atts & JS_DONTCONF)
 			return 0;
 		jsV_delproperty(J, obj, name);
 	}
@@ -625,7 +625,7 @@
 
 static void js_decvar(js_State *J, const char *name, int idx)
 {
-	jsR_defproperty(J, J->E->variables, name, JS_DONTENUM | JS_DONTDELETE, stackidx(J, idx), NULL, NULL);
+	jsR_defproperty(J, J->E->variables, name, JS_DONTENUM | JS_DONTCONF, stackidx(J, idx), NULL, NULL);
 }
 
 static void js_getvar(js_State *J, const char *name)
@@ -665,7 +665,7 @@
 	do {
 		js_Property *ref = jsV_getownproperty(J, E->variables, name);
 		if (ref) {
-			if (ref->atts & JS_DONTDELETE)
+			if (ref->atts & JS_DONTCONF)
 				return 0;
 			jsV_delproperty(J, E->variables, name);
 			return 1;
--- a/jsvalue.c
+++ b/jsvalue.c
@@ -194,7 +194,7 @@
 		ref = jsV_setproperty(J, obj, "length");
 		ref->value.type = JS_TNUMBER;
 		ref->value.u.number = utflen(v);
-		ref->atts = JS_READONLY | JS_DONTENUM | JS_DONTDELETE;
+		ref->atts = JS_READONLY | JS_DONTENUM | JS_DONTCONF;
 	}
 	return obj;
 }
@@ -246,13 +246,13 @@
 	js_pushobject(J, obj);
 	{
 		js_pushnumber(J, fun->numparams);
-		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 		js_newobject(J);
 		{
 			js_copy(J, -2);
 			js_defproperty(J, -2, "constructor", JS_DONTENUM);
 		}
-		js_defproperty(J, -2, "prototype", JS_DONTDELETE);
+		js_defproperty(J, -2, "prototype", JS_DONTCONF);
 	}
 }
 
@@ -272,13 +272,13 @@
 	js_pushobject(J, obj);
 	{
 		js_pushnumber(J, length);
-		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 		js_newobject(J);
 		{
 			js_copy(J, -2);
 			js_defproperty(J, -2, "constructor", JS_DONTENUM);
 		}
-		js_defproperty(J, -2, "prototype", JS_DONTDELETE);
+		js_defproperty(J, -2, "prototype", JS_DONTCONF);
 	}
 }
 
@@ -291,11 +291,11 @@
 	js_pushobject(J, obj); /* proto obj */
 	{
 		js_pushnumber(J, length);
-		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+		js_defproperty(J, -2, "length", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 		js_rot2(J); /* obj proto */
 		js_copy(J, -2); /* obj proto obj */
 		js_defproperty(J, -2, "constructor", JS_DONTENUM);
-		js_defproperty(J, -2, "prototype", JS_READONLY | JS_DONTENUM | JS_DONTDELETE);
+		js_defproperty(J, -2, "prototype", JS_READONLY | JS_DONTENUM | JS_DONTCONF);
 	}
 }