Skip to content

object: Warn if passing more than one argument to default constructor

The default constructor of GObjects takes one optional object which is treated as a property hash. Any subsequent arguments are ignored, as is normal in JavaScript.

However, since we do log a warning about extra arguments to GObject-introspected functions being ignored, it seems reasonable that we should also log a warning when extra arguments to the default GObject constructor are ignored.

Also adds some tests for the functionality that was already there: throwing if something that's not an object is passed in, and allowing an object that's not a plain JavaScript object.

Closes: #63 (closed).

Merge request reports