Closed Bug 453437 Opened 17 years ago Closed 17 years ago

NewAPI: Add support for evaluating JavaScript

Categories

(Core Graveyard :: Embedding: APIs, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pelle.johnsen, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: It should be possible (and easy) to evaluate JavaScript from an embedding app. using the new API. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Attached patch Add EvaluateJS method to MozView (obsolete) — Splinter Review
Added initial patch. Not to happy about all the string handling, but the plan with the new API was to return strings using utf-8 char* which the caller should be responsible for freeing.
Updated patch after comments from mbrkaplan to set ScriptObject and Principal correctly. Ready for review.
Attachment #336644 - Attachment is obsolete: true
Attachment #339039 - Flags: review?(mark.finkle)
Can you add to the doc around the API that the string you pass in should be in UTF-8? It's implied by the code, but we should make it explicit in the docs as well. Also, awesome!
Updated patch to include utf-8 in doxygen comments
Attachment #339039 - Attachment is obsolete: true
Attachment #339417 - Flags: review?(mark.finkle)
Attachment #339039 - Flags: review?(mark.finkle)
Attachment #339417 - Flags: review?(mark.finkle) → review+
Comment on attachment 339417 [details] [diff] [review] Updated doxygen comments to specify utf-8 strings I was trying to determine if we should return a string or a variant-ish kind of object from EvaluateJS, but the underlying method does return a string. One nit: Can we rename the method to EvaluateScript or EvaluateJavaScript? I'm not a bugu fan of abbreviations in code names.
Pushed to incubator/embedding, with method renamed to EvaluateJavaScript
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: