summaryrefslogtreecommitdiff
path: root/INTERPRETING.md
diff options
context:
space:
mode:
authorjugglinmike <mike@mikepennisi.com>2016-06-21 12:11:18 -0400
committerLeo Balter <leonardo.balter@gmail.com>2016-06-21 12:11:18 -0400
commit10e4bdf0b64e011123aa121a512b0607bfd028ca (patch)
treec340b6b28df252371f04e1bf89f52c6effe00ed0 /INTERPRETING.md
parent813bb5166c4a26598fcf59e7a585c46baec331fc (diff)
downloadqtdeclarative-testsuites-10e4bdf0b64e011123aa121a512b0607bfd028ca.tar.gz
Document host-defined realm/script API (#644)
Define the expected behavior of new host-defined utilities. These will facilitate forthcoming tests that concern cross-realm and cross-script semantics (which are currently untestable using standard ECMAScript alone).
Diffstat (limited to 'INTERPRETING.md')
-rw-r--r--INTERPRETING.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/INTERPRETING.md b/INTERPRETING.md
index ed76fae8e..8ebaa8e47 100644
--- a/INTERPRETING.md
+++ b/INTERPRETING.md
@@ -34,6 +34,32 @@ properties of the global scope prior to test execution.
- **`print`** A function that exposes the string value of its first argument to
the test runner. This is used as a communication mechanism for asynchronous
tests (via the `async` flag, described below).
+- **`$`** An ordinary object with the following properties:
+ - **`createRealm`** - a function which creates a new [ECMAScript
+ Realm](https://tc39.github.io/ecma262/2016/#sec-code-realms),
+ defines this API on the new realm's global object, and returns the `$`
+ property of the new realm's global object
+ - **`detachArrayBuffer`** - a function which implements [the
+ DetachArrayBuffer abstract
+ operation](https://tc39.github.io/ecma262/2016/#sec-detacharraybuffer)
+ - **`evalScript`** - a function which accepts a string value as its first
+ argument and executes is as [an ECMAScript
+ script](https://tc39.github.io/ecma262/2016/#sec-scripts) according to the
+ following algorithm:
+
+ 1. Let hostDefined be any host-defined values for the provided
+ sourceText (obtained in an implementation dependent manner)
+ 2. Let realm be the current Realm Record.
+ 3. Let s be ParseScript(sourceText, realm, hostDefined).
+ 4. If s is a List of errors, then
+ a. Let error be the first element of s.
+ b. Return
+ Completion{[[Type]]: throw, [[Value]]: error, [[Target]]: empty}.
+ 5. Let status be ScriptEvaluation(s).
+ 6. Return Completion(status).
+
+ - **`global`** - a reference to the global object on which `$` was initially
+ defined
### Strict Mode