I'm using var jsc = this["\x24"]; instead of just writing var jsc = $;, or even just extending $ if it exists, because the contents of the files in runtimes/* are not executed exactly as they appear. Each file experiences some amount of "processing" that will change the actual text content that eventually gets prepended to the test262 test source code. The bare minimum change that's applied is replacing all occurrences of $ to $262 (or whatever the shortName property is set to). Unfortunately, that means we cannot rely on the existence of an Identifier $ (or $262) in that code.
See: https://github.com/WebKit/webkit/blob/aeed7ff2493053fb9ffcc06fedc7e75311bacc8a/Source/JavaScriptCore/jsc.cpp#L574-L604
This enables tests that require $262.agent.*
I'm using
var jsc = this["\x24"];
instead of just writingvar jsc = $;
, or even just extending$
if it exists, because the contents of the files inruntimes/*
are not executed exactly as they appear. Each file experiences some amount of "processing" that will change the actual text content that eventually gets prepended to the test262 test source code. The bare minimum change that's applied is replacing all occurrences of$
to$262
(or whatever theshortName
property is set to). Unfortunately, that means we cannot rely on the existence of an Identifier$
(or$262
) in that code.