Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Issue 6902104: Don't exchange null and undefined with the global object in function.prototype.{call, apply} for ... (Closed)

Created:
9 years, 8 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein, MarkM
CC:
v8-dev
Visibility:
Public.

Description

Don't exchange null and undefined with the global object in function.prototype.{call, apply} for natives. This makes us compatible with firefox in throwing an exception when call is invoked on a builtin with null as the this argument. Committed: http://code.google.com/p/v8/source/detail?r=7763

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 28

Patch Set 3 : '' #

Total comments: 4

Patch Set 4 : '' #

Total comments: 4

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+559 lines, -49 lines) Patch
M src/array.js View 1 2 3 4 19 chunks +95 lines, -0 lines 0 comments Download
M src/date.js View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
src/ia32/builtins-ia32.cc View 2 chunks +20 lines, -1 line 0 comments Download
M src/messages.js View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M src/string.js View 1 2 14 chunks +79 lines, -0 lines 0 comments Download
M src/v8natives.js View 1 2 6 chunks +28 lines, -0 lines 0 comments Download
M test/es5conform/es5conform.status View 1 2 3 2 chunks +0 lines, -12 lines 0 comments Download
A test/mjsunit/function-call.js View 1 2 3 1 chunk +326 lines, -0 lines 0 comments Download
M test/mjsunit/regress/regress-485.js View 1 chunk +0 lines, -13 lines 0 comments Download
M test/mozilla/mozilla.status View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M test/sputnik/sputnik.status View 1 2 3 3 chunks +1 line, -21 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Rico
http://codereview.chromium.org/6902104/diff/1/src/ia32/builtins-ia32.cc File src/ia32/builtins-ia32.cc (right): http://codereview.chromium.org/6902104/diff/1/src/ia32/builtins-ia32.cc#newcode608 src/ia32/builtins-ia32.cc:608: __ cmp(ebx, Script::TYPE_NATIVE); We could just test ebx without ...
9 years, 8 months ago (2011-04-28 05:57:59 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/6902104/diff/3001/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/3001/src/array.js#newcode378 src/array.js:378: if (IS_NULL_OR_UNDEFINED(this)) { Is this correct behavior for ...
9 years, 8 months ago (2011-04-28 10:44:38 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/6902104/diff/3001/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/3001/src/array.js#newcode378 src/array.js:378: if (IS_NULL_OR_UNDEFINED(this)) { Just checked Firefox 4. It does ...
9 years, 8 months ago (2011-04-28 10:50:01 UTC) #3
MarkM
http://codereview.chromium.org/6902104/diff/3001/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/3001/src/array.js#newcode378 src/array.js:378: if (IS_NULL_OR_UNDEFINED(this)) { On 2011/04/28 10:50:01, Lasse Reichstein wrote: ...
9 years, 8 months ago (2011-04-28 15:40:45 UTC) #4
Lasse Reichstein
Ah, yes. I also tested a Webkit Nightly, and they also don't throw on document.all: ...
9 years, 8 months ago (2011-04-28 16:41:11 UTC) #5
Lasse Reichstein
But then, it doesn't throw on "undefined" either.
9 years, 8 months ago (2011-04-28 16:44:02 UTC) #6
MarkM
http://codereview.chromium.org/6902104/diff/3001/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/3001/src/array.js#newcode379 src/array.js:379: throw MakeTypeError("obj_ctor_property_non_object", ["Array.join"]); For all these generics, I wonder ...
9 years, 8 months ago (2011-04-28 18:58:21 UTC) #7
Lasse Reichstein
Since Safari isn't already doing something, we are free to do what we want with ...
9 years, 8 months ago (2011-04-28 19:13:19 UTC) #8
MarkM
http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js File test/mjsunit/function-call.js (right): http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js#newcode35 test/mjsunit/function-call.js:35: // Array.prototype.toString, Why are these commented out? http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js#newcode160 test/mjsunit/function-call.js:160: ...
9 years, 8 months ago (2011-04-28 21:16:54 UTC) #9
Lasse Reichstein
http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js File test/mjsunit/function-call.js (right): http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js#newcode80 test/mjsunit/function-call.js:80: [Function.prototype.toString, How about Function.prototype.call and Function.prototype.apply? :) http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js#newcode149 test/mjsunit/function-call.js:149: ...
9 years, 8 months ago (2011-04-29 06:16:12 UTC) #10
Rico
http://codereview.chromium.org/6902104/diff/3001/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/3001/src/array.js#newcode378 src/array.js:378: if (IS_NULL_OR_UNDEFINED(this)) { On 2011/04/28 15:40:45, MarkM wrote: > ...
9 years, 7 months ago (2011-05-03 08:47:20 UTC) #11
Lasse Reichstein
LGTM http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js File test/mjsunit/function-call.js (right): http://codereview.chromium.org/6902104/diff/3001/test/mjsunit/function-call.js#newcode149 test/mjsunit/function-call.js:149: Array.prototype.reduceRight]; No, but I think we should use ...
9 years, 7 months ago (2011-05-03 09:01:02 UTC) #12
Rico
Please have another look: Addressed comments Changed Array.prototype.toString and toLocaleString to only work on arrays ...
9 years, 7 months ago (2011-05-03 12:41:02 UTC) #13
Lasse Reichstein
LGTM http://codereview.chromium.org/6902104/diff/11003/src/array.js File src/array.js (right): http://codereview.chromium.org/6902104/diff/11003/src/array.js#newcode366 src/array.js:366: if (!IS_ARRAY(this)) { Remove the test above, then. ...
9 years, 7 months ago (2011-05-03 13:06:52 UTC) #14
Rico
9 years, 7 months ago (2011-05-03 13:15:38 UTC) #15
http://codereview.chromium.org/6902104/diff/11003/src/array.js
File src/array.js (right):

http://codereview.chromium.org/6902104/diff/11003/src/array.js#newcode366
src/array.js:366: if (!IS_ARRAY(this)) {
On 2011/05/03 13:06:52, Lasse Reichstein wrote:
> Remove the test above, then. 

Done.

http://codereview.chromium.org/6902104/diff/11003/src/array.js#newcode378
src/array.js:378: if (!IS_ARRAY(this)) {
On 2011/05/03 13:06:52, Lasse Reichstein wrote:
> Ditto

Done.

Powered by Google App Engine
This is Rietveld 408576698