You can use, for example, the --allow_natives_syntax or --expose_natives_as option.
Here are examples where MathLog is randomly selected in src / math.js:
First compile the shell with
$ scons d8 -j8
Then use -expose_natives_as:
$ ./d8 --expose_natives_as nat
V8 version 3.12.7 (candidate) [console: dumb]
d8> nat.MathLog(100)
4.605170185988092
or use --allow_natives_syntax with the prefix "%":
$ ./d8 --allow_natives_syntax
V8 version 3.12.7 (candidate) [console: dumb]
d8> %MathLog(100)
4.605170185988092
Rames source
share