summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2017-03-19 05:00:48 +0000
committerPhilip Chimento <philip.chimento@gmail.com>2017-05-05 23:26:30 -0700
commit78c87c9ff16d9b21ffa11f91c3280046a5a3217f (patch)
treec128b5113d08e49a7a472f8957d866c52a44e8be
parentbfaeab1886daf2458caf94b9a06d7ead3ac24d72 (diff)
downloadgjs-78c87c9ff16d9b21ffa11f91c3280046a5a3217f.tar.gz
js: Switch from JS::NullPtr() to nullptr
JS::NullPtr() is gone, and instead now functions that took JS::NullPtr() as a null handle value take nullptr_t, so we should use C++ nullptr.
-rw-r--r--gi/boxed.cpp4
-rw-r--r--gi/closure.cpp2
-rw-r--r--gi/function.cpp2
-rw-r--r--gi/gtype.cpp5
-rw-r--r--gi/interface.cpp4
-rw-r--r--gi/ns.cpp2
-rw-r--r--gi/param.cpp4
-rw-r--r--gi/repo.cpp2
-rw-r--r--gi/union.cpp3
-rw-r--r--gjs/context.cpp2
-rw-r--r--gjs/importer.cpp4
-rw-r--r--gjs/jsapi-util.cpp2
12 files changed, 15 insertions, 21 deletions
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 938c78b5..6b4e2615 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -333,7 +333,7 @@ boxed_invoke_constructor(JSContext *context,
constructor_name, &js_constructor_func))
return false;
- return gjs_call_function_value(context, JS::NullPtr(), js_constructor_func,
+ return gjs_call_function_value(context, nullptr, js_constructor_func,
args, args.rval());
}
@@ -1159,7 +1159,7 @@ gjs_define_boxed_class(JSContext *context,
constructor_name = g_base_info_get_name( (GIBaseInfo*) info);
if (!gjs_init_class_dynamic(context, in_object,
- JS::NullPtr(), /* parent prototype */
+ nullptr, /* parent prototype */
g_base_info_get_namespace( (GIBaseInfo*) info),
constructor_name,
&gjs_boxed_class,
diff --git a/gi/closure.cpp b/gi/closure.cpp
index e3ef0ba8..b314ebb1 100644
--- a/gi/closure.cpp
+++ b/gi/closure.cpp
@@ -225,7 +225,7 @@ gjs_closure_invoke(GClosure *closure,
JS::RootedValue v_closure(context, JS::ObjectValue(*c->obj));
if (!gjs_call_function_value(context,
/* "this" object; null is some kind of default presumably */
- JS::NullPtr(),
+ nullptr,
v_closure, args, retval)) {
/* Exception thrown... */
gjs_debug_closure("Closure invocation failed (exception should "
diff --git a/gi/function.cpp b/gi/function.cpp
index e3a6c9f2..94d9028e 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1678,7 +1678,7 @@ function_new(JSContext *context,
Function *priv;
JS::RootedObject proto(context);
- if (!gjs_function_define_proto(context, JS::NullPtr(), &proto))
+ if (!gjs_function_define_proto(context, nullptr, &proto))
return nullptr;
JS::RootedObject function(context,
diff --git a/gi/gtype.cpp b/gi/gtype.cpp
index d1d5669e..4c19a3b6 100644
--- a/gi/gtype.cpp
+++ b/gi/gtype.cpp
@@ -159,12 +159,11 @@ gjs_gtype_create_gtype_wrapper (JSContext *context,
return *heap_wrapper;
JS::RootedObject proto(context);
- if (!gjs_gtype_define_proto(context, JS::NullPtr(), &proto))
+ if (!gjs_gtype_define_proto(context, nullptr, &proto))
return nullptr;
heap_wrapper = new JS::Heap<JSObject *>();
- *heap_wrapper = JS_NewObjectWithGivenProto(context, &gjs_gtype_class, proto,
- JS::NullPtr());
+ *heap_wrapper = JS_NewObjectWithGivenProto(context, &gjs_gtype_class, proto);
if (*heap_wrapper == nullptr)
return nullptr;
diff --git a/gi/interface.cpp b/gi/interface.cpp
index 712702bc..00a87e71 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -200,9 +200,7 @@ gjs_define_interface_class(JSContext *context,
ns = gjs_get_names_from_gtype_and_gi_info(gtype, (GIBaseInfo *) info,
&constructor_name);
- if (!gjs_init_class_dynamic(context, in_object,
- JS::NullPtr(),
- ns,
+ if (!gjs_init_class_dynamic(context, in_object, nullptr, ns,
constructor_name,
&gjs_interface_class,
gjs_interface_constructor, 0,
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 9406cd6e..c892741b 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -187,7 +187,7 @@ ns_new(JSContext *context,
Ns *priv;
JS::RootedObject proto(context);
- if (!gjs_ns_define_proto(context, JS::NullPtr(), &proto))
+ if (!gjs_ns_define_proto(context, nullptr, &proto))
return nullptr;
JS::RootedObject ns(context,
diff --git a/gi/param.cpp b/gi/param.cpp
index c38eebb0..c9a1ccdf 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -211,9 +211,7 @@ gjs_define_param_class(JSContext *context,
constructor_name = "ParamSpec";
- if (!gjs_init_class_dynamic(context, in_object,
- JS::NullPtr(),
- "GObject",
+ if (!gjs_init_class_dynamic(context, in_object, nullptr, "GObject",
constructor_name,
&gjs_param_class,
gjs_param_constructor, 0,
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 10fd4658..c1f84507 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -251,7 +251,7 @@ repo_new(JSContext *context)
Repo *priv;
JS::RootedObject proto(context);
- if (!gjs_repo_define_proto(context, JS::NullPtr(), &proto))
+ if (!gjs_repo_define_proto(context, nullptr, &proto))
return nullptr;
JS::RootedObject repo(context,
diff --git a/gi/union.cpp b/gi/union.cpp
index c4ef1037..47f85f69 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -341,8 +341,7 @@ gjs_define_union_class(JSContext *context,
constructor_name = g_base_info_get_name( (GIBaseInfo*) info);
- if (!gjs_init_class_dynamic(context, in_object,
- JS::NullPtr(),
+ if (!gjs_init_class_dynamic(context, in_object, nullptr,
g_base_info_get_namespace( (GIBaseInfo*) info),
constructor_name,
&gjs_union_class,
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 2b506c2c..24a615b2 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -760,7 +760,7 @@ gjs_context_eval(GjsContext *js_context,
g_object_ref(G_OBJECT(js_context));
JS::RootedValue retval(js_context->context);
- if (!gjs_eval_with_scope(js_context->context, JS::NullPtr(), script,
+ if (!gjs_eval_with_scope(js_context->context, nullptr, script,
script_len, filename, &retval)) {
uint8_t code;
if (_gjs_context_should_exit(js_context, &code)) {
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index c930eba9..0ad7880b 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -909,7 +909,7 @@ importer_new(JSContext *context,
Importer *priv;
JS::RootedObject proto(context);
- if (!gjs_importer_define_proto(context, JS::NullPtr(), &proto))
+ if (!gjs_importer_define_proto(context, nullptr, &proto))
g_error("Error creating importer prototype");
JS::RootedObject importer(context,
@@ -1079,7 +1079,7 @@ gjs_create_root_importer(JSContext *context,
importer = JS::ObjectValue(*gjs_create_importer(context, "imports",
initial_search_path,
add_standard_search_path,
- true, JS::NullPtr()));
+ true, nullptr));
gjs_set_global_slot(context, GJS_GLOBAL_SLOT_IMPORTS, importer);
JS_EndRequest(context);
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 900b1b48..84071743 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -693,7 +693,7 @@ gjs_log_exception(JSContext *context)
JS_ClearPendingException(context);
- gjs_log_exception_full(context, exc, JS::NullPtr());
+ gjs_log_exception_full(context, exc, nullptr);
retval = true;