Split setSource into two methods

RESOLVED FIXED in mozilla17

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Benjamin, Assigned: Benjamin)

Tracking

unspecified
mozilla17
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
ScriptSource::setSource takes a ownSource parameter, which is supposed to control whether the script source copies or takes ownership of the source. However, they don't share much in terms of implementation. There ought to be two methods: one that copies and one that simply takes ownership of the source pointer.
(Assignee)

Comment 1

5 years ago
Created attachment 647833 [details] [diff] [review]
perform split
Assignee: general → bpeterson
Attachment #647833 - Flags: review?(jorendorff)
Comment on attachment 647833 [details] [diff] [review]
perform split

Review of attachment 647833 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsscript.cpp
@@ +1268,5 @@
> +ScriptSource::setSource(const jschar *src, uint32_t length)
> +{
> +    JS_ASSERT(!hasSourceData());
> +    length_ = length;
> +    data.source = const_cast<jschar *>(src);

Before this patch, we set argumentsNotIncluded_ to false here; maybe assert it's false?
Attachment #647833 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/45308696575a
https://hg.mozilla.org/mozilla-central/rev/45308696575a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.