remove module checks
This commit is contained in:
@@ -8,11 +8,4 @@ for (var i = 0; i < N; i ++) {
|
||||
}
|
||||
log.console(2 * num / N);
|
||||
|
||||
var a = 100
|
||||
var b = 100
|
||||
|
||||
if ("test") log.console("OK!")
|
||||
|
||||
log.console(a != b)
|
||||
|
||||
$_.stop()
|
||||
@@ -125,7 +125,6 @@ enum {
|
||||
JS_CLASS_SYMBOL, /* u.object_data */
|
||||
JS_CLASS_ARGUMENTS, /* u.array | length */
|
||||
JS_CLASS_MAPPED_ARGUMENTS, /* | length */
|
||||
JS_CLASS_MODULE_NS,
|
||||
JS_CLASS_C_FUNCTION, /* u.cfunc */
|
||||
JS_CLASS_BYTECODE_FUNCTION, /* u.func */
|
||||
JS_CLASS_BOUND_FUNCTION, /* u.bound_function */
|
||||
@@ -1009,7 +1008,6 @@ static JSValue js_error_toString(JSContext *ctx, JSValueConst this_val,
|
||||
static const JSClassExoticMethods js_arguments_exotic_methods;
|
||||
static const JSClassExoticMethods js_string_exotic_methods;
|
||||
static const JSClassExoticMethods js_proxy_exotic_methods;
|
||||
static const JSClassExoticMethods js_module_ns_exotic_methods;
|
||||
static JSClassID js_class_id_alloc = JS_CLASS_INIT_COUNT;
|
||||
|
||||
static void js_trigger_gc(JSRuntime *rt, size_t size)
|
||||
@@ -1201,7 +1199,6 @@ static JSClassShortDef const js_std_class_def[] = {
|
||||
{ JS_ATOM_Symbol, js_object_data_finalizer, js_object_data_mark }, /* JS_CLASS_SYMBOL */
|
||||
{ JS_ATOM_Arguments, js_array_finalizer, js_array_mark }, /* JS_CLASS_ARGUMENTS */
|
||||
{ JS_ATOM_Arguments, NULL, NULL }, /* JS_CLASS_MAPPED_ARGUMENTS */
|
||||
{ JS_ATOM_Object, NULL, NULL }, /* JS_CLASS_MODULE_NS */
|
||||
{ JS_ATOM_Function, js_c_function_finalizer, js_c_function_mark }, /* JS_CLASS_C_FUNCTION */
|
||||
{ JS_ATOM_Function, js_bytecode_function_finalizer, js_bytecode_function_mark }, /* JS_CLASS_BYTECODE_FUNCTION */
|
||||
{ JS_ATOM_Function, js_bound_function_finalizer, js_bound_function_mark }, /* JS_CLASS_BOUND_FUNCTION */
|
||||
@@ -1303,7 +1300,6 @@ JSRuntime *JS_NewRuntime2(const JSMallocFunctions *mf, void *opaque)
|
||||
goto fail;
|
||||
rt->class_array[JS_CLASS_ARGUMENTS].exotic = &js_arguments_exotic_methods;
|
||||
rt->class_array[JS_CLASS_STRING].exotic = &js_string_exotic_methods;
|
||||
rt->class_array[JS_CLASS_MODULE_NS].exotic = &js_module_ns_exotic_methods;
|
||||
|
||||
rt->class_array[JS_CLASS_C_FUNCTION].call = js_call_c_function;
|
||||
rt->class_array[JS_CLASS_C_FUNCTION_DATA].call = js_c_function_data_call;
|
||||
@@ -8108,11 +8104,6 @@ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
|
||||
} else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_GETSET) {
|
||||
return call_setter(ctx, pr->u.getset.setter, this_obj, val, flags);
|
||||
} else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
|
||||
/* JS_PROP_WRITABLE is always true for variable
|
||||
references, but they are write protected in module name
|
||||
spaces. */
|
||||
if (p->class_id == JS_CLASS_MODULE_NS)
|
||||
goto read_only_prop;
|
||||
set_value(ctx, pr->u.var_ref->pvalue, val);
|
||||
return TRUE;
|
||||
} else if ((prs->flags & JS_PROP_TMASK) == JS_PROP_AUTOINIT) {
|
||||
@@ -8269,8 +8260,7 @@ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
|
||||
return JS_ThrowTypeErrorOrFalse(ctx, flags, "setter is forbidden");
|
||||
} else {
|
||||
JS_FreeValue(ctx, desc.value);
|
||||
if (!(desc.flags & JS_PROP_WRITABLE) ||
|
||||
p->class_id == JS_CLASS_MODULE_NS) {
|
||||
if (!(desc.flags & JS_PROP_WRITABLE)) {
|
||||
read_only_prop:
|
||||
JS_FreeValue(ctx, val);
|
||||
return JS_ThrowTypeErrorReadOnly(ctx, flags, prop);
|
||||
@@ -8725,25 +8715,14 @@ int JS_DefineProperty(JSContext *ctx, JSValueConst this_obj,
|
||||
}
|
||||
if ((prs->flags & JS_PROP_TMASK) == JS_PROP_VARREF) {
|
||||
if (flags & JS_PROP_HAS_VALUE) {
|
||||
if (p->class_id == JS_CLASS_MODULE_NS) {
|
||||
/* JS_PROP_WRITABLE is always true for variable
|
||||
references, but they are write protected in module name
|
||||
spaces. */
|
||||
if (!js_same_value(ctx, val, *pr->u.var_ref->pvalue))
|
||||
goto not_configurable;
|
||||
} else {
|
||||
/* update the reference */
|
||||
set_value(ctx, pr->u.var_ref->pvalue,
|
||||
JS_DupValue(ctx, val));
|
||||
}
|
||||
/* update the reference */
|
||||
set_value(ctx, pr->u.var_ref->pvalue,
|
||||
JS_DupValue(ctx, val));
|
||||
}
|
||||
/* if writable is set to false, no longer a
|
||||
reference (for mapped arguments) */
|
||||
if ((flags & (JS_PROP_HAS_WRITABLE | JS_PROP_WRITABLE)) == JS_PROP_HAS_WRITABLE) {
|
||||
JSValue val1;
|
||||
if (p->class_id == JS_CLASS_MODULE_NS) {
|
||||
return JS_ThrowTypeErrorOrFalse(ctx, flags, "module namespace properties have writable = false");
|
||||
}
|
||||
if (js_shape_prepare_update(ctx, p, &prs))
|
||||
return -1;
|
||||
val1 = JS_DupValue(ctx, *pr->u.var_ref->pvalue);
|
||||
|
||||
Reference in New Issue
Block a user