https://codereview.chromium.org/21924007/diff/3001/src/collection.js
File src/collection.js (right):

https://codereview.chromium.org/21924007/diff/3001/src/collection.js#newcode52
src/collection.js:52: if (!IS_SET(this)) {
On 2013/08/05 10:15:22, Dmitry Lomov (chromium) wrote:
On 2013/08/04 16:44:28, arv wrote:
> Remember that all of these needs to be changed to actually test that
it is an
> initialized Set and not just a Set.
>
> var uninitializedSet = %NewObject(Set);
> assertThrows(function() {
>   Set.prototype.add.call(uninitializedSet, 'key');
> }, TypeError);
>
> At this point, the only way to get  an uninitialized Set is to use
%NewObject
so
> and user code will not be able to trigger this. But once we expose
@@create
this
> will need to be fixed.

Do you think we should fix all of these in this CL or we can do other
error
checking in later CLs? (this whole @@create thing is a can of worms,
obviously)

I think it is fine to do this later. It is not observable without
%NewObject

https://codereview.chromium.org/21924007/diff/3001/src/runtime.cc
File src/runtime.cc (right):

https://codereview.chromium.org/21924007/diff/3001/src/runtime.cc#newcode914
src/runtime.cc:914: ArrayIdToTypeAndSize(arrayId, &array_type,
&element_size, &name);
On 2013/08/05 10:15:22, Dmitry Lomov (chromium) wrote:
On 2013/08/04 16:44:28, arv wrote:
> Can you move this code into the error cases? The common case is that
there is
no
> error and we can skip all this extra work just to get the name that
we are not
> going to use.

Done. Do you think it's cleaner that way? (Perf impact is non-existent
of
course)


Sorry, I think my comment was bad advice. I didn't realize that this
work needs to be done in the common case anyway. Adding the name will be
lost in the noise. I didn't realize how much work is done on
initialization anyway.

I'll let you determine which way you prefer. The old way is definitely
cleaner.

https://codereview.chromium.org/21924007/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to