ECMAScript Logger

Overall idea

The ecmascript-logger is a noninteractive tool used to log all the source code executed by Opera's ECMAScript engine.

Requirements

(req.log-source) Log script source

[Status: strawman requirement; author: lth]

All scripts compiled by the engine should be captured and displayed.

A logged script has three parts: type, url, and text.

(req.reformatting) Make Opera reformat the source code before logging

[Status: strawman requirement; author: lth]

The tool should allow the user to control whether Opera reformats the source code before sending it, provided the script logger is the only tool trying to control that behavior.

Protocol

This is a two-way asynchronous XML-based protocol.

The service name of the ECMAScript logger is "ecmascript-logger".

Configuration: set-parameters

The tool can configure the logger by sending a set-parameters message:

    <set-parameters reformat="boolean" />
where a boolean value is "yes" or "no". If the value is "yes", source code will be reformatted before compilation (currently through an expensive process of compilation, decompilation, and recompilation of the decompiled data), and the reformatted code will be sent to the script logger tool.

Data: newscript

The script logger nub in Opera sends records on the following form:

    <newscript>
      <type value="type keyword"/>
      <url value="url"/>
      <source>text</source>
    </newscript>
where type keyword is the type of script ("inline", "linked", etc; may be "none"), url is the string "none" or the URL at which the script originated; and text is the source code.