A js::rust::Compartment is little more than a glorified pointer to the
reflector of a window, so there's no good reason to use it. Instead, this
commit passes a JS<Window> directly when it's necessary.
This also means that we now have to use JS_DefineFunctions rather than
Compartment::define_functions; I believe the former is clearer to the reader
than the extra indirection involved in the latter calling through three
reopsitories.
This commit also simplifies ScriptTask::load to reuse the 'cx' local that is
in scope already, rather than refetching it through js_info.
A js::rust::Compartment is little more than a glorified pointer to the
reflector of a window, so there's no good reason to use it. Instead, this
commit passes a JS<Window> directly when it's necessary.
This also means that we now have to use JS_DefineFunctions rather than
Compartment::define_functions; I believe the former is clearer to the reader
than the extra indirection involved in the latter calling through three
reopsitories.
This commit also simplifies ScriptTask::load to reuse the 'cx' local that is
in scope already, rather than refetching it through js_info.
Since we are keeping the results of previous tests locally (in metadata/), we should probably also track the generated MANIFEST file.
It won't get updated locally when the ini files are updated, which can lead to an outdated manifest.
This is a stab at #2401 - I think this was what @jdm had in mind for a fix.
I've also included a test. There's no "i tried" star, I'm too much of a newb for that, but hopefully the test at least confirms that servo doesn't crash on HTTPS requests.
...the dictionary conversion codegen.
This also explicitly disallows dictionary members without a default value, as
the code for those doesn't currently compile.
This is the second step of my planned rewrite of the dictionary initialization
that will remove the default values we currently use to initialize the
dictionary struct in the 'new' function.
This also explicitly disallows dictionary members without a default value, as
the code for those doesn't currently compile.
This is the second step of my planned rewrite of the dictionary initialization
that will remove the default values we currently use to initialize the
dictionary struct in the 'new' function.
#2162 was a tad off, it moves the virtualenv to the object directory (x86_64-unknown-linux-gnu, etc) instead of the build directory (build/, or whatever you're using). This moves it back. (Otherwise the `clean-wpt` target won't work)
This moves the code in callers more in line with conversions for other types
and ensures the default values given to the dictionary fields (as defined by
the defaultValue function in CGDictionary.impl) do not escape the 'new'
method. The new code is also more in line with the code used by the
FromJSValConvertible trait.
This is the first step of my planned rewrite of the dictionary initialization
that will remove the default values entirely and reduce the code
duplication in the 'Init' (now 'new') function.
This change allows us to use the code even in cases where we return a
Result type rather than a JSBool. Interface, primitive and union types
already get this right.
See #1479
This sets up a basic environment for running wpt. It instantiates a virtualenv, generates the manifest if it doesn't exist*, and runs the tests.
Currently @Ms2ger's [`run-in-servo` fork of wpt](https://github.com/Ms2ger/web-platform-tests/tree/run-in-servo/) is used.
Note: I did everything in a shell script instead of make since one cannot run `source` from a makefile (the environment is immutable, apparently)
*It does not, however, update the manifest. We'll have to add an extra script for that.
The previous code would return success from the JSNative with a pending
exception, potentially leading to assertion failures inside the JS engine
later.