Closed Bug 779400 Opened 10 years ago Closed 10 years ago

Split setSource into two methods

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: Benjamin, Assigned: Benjamin)

Details

Attachments

(1 file)

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.
Attached patch perform splitSplinter Review
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+
https://hg.mozilla.org/mozilla-central/rev/45308696575a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.