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

Issue 2688393003: Fix TypeError message for Reflect.construct (Closed)

Created:
3 years, 10 months ago by vabr (Chromium)
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com, v8-mips-ports_googlegroups.com, v8-x87-ports_googlegroups.com, v8-ppc-ports_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix TypeError message for Reflect.construct If the Reflect.construct receives an argument expected to be a constructor, and the argument is not a constructor, V8 currently declares that Reflect.construct is not a function. It should instead say that the offending argument is not a constructor. This is the case for all ports of builtins (Builtins::Generate_ReflectConstruct). All of them make an attempt to at least pass the right argument to the TypeError parametrised message, calling out the offending Reflect.construct argument. However, Runtime::kThrowCalledNonCallable extracts the callsite from those arguments, discarding the precise information. This CL adds Runtime::kNotConstructor, which reports the arguments passed to it, and the CL also modifies the ports of builtins to make use of Runtime::kNotConstructor BUG=v8:5671 Review-Url: https://codereview.chromium.org/2688393003 Cr-Commit-Position: refs/heads/master@{#43182} Committed: https://chromium.googlesource.com/v8/v8/+/b478e9c11c3b01e4b34607182bab4774334f0e4d

Patch Set 1 #

Patch Set 2 : Fix ARM #

Patch Set 3 : Fix the rest #

Total comments: 2

Patch Set 4 : NotConstructor -> ThrowNotConstructor #

Patch Set 5 : Fix order in runtime-internal.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -19 lines) Patch
M src/builtins/arm/builtins-arm.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/arm64/builtins-arm64.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/ia32/builtins-ia32.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/mips/builtins-mips.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/mips64/builtins-mips64.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/ppc/builtins-ppc.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/s390/builtins-s390.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/builtins/x64/builtins-x64.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M src/builtins/x87/builtins-x87.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime/runtime-internal.cc View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M test/mjsunit/es6/reflect-construct.js View 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (17 generated)
vabr (Chromium)
Hi all, Could you please review as follows? michael_dawson@ca.ibm.com: ppc and s390 chunyang.dai@intel.com: x87 akos.palfi@imgtec.com: ...
3 years, 10 months ago (2017-02-12 22:46:35 UTC) #13
Benedikt Meurer
LGTM. Thanks!
3 years, 10 months ago (2017-02-14 04:06:02 UTC) #15
Benedikt Meurer
Err, sorry, forgot to send comments. Please fix the naming. https://codereview.chromium.org/2688393003/diff/40001/src/runtime/runtime-internal.cc File src/runtime/runtime-internal.cc (right): https://codereview.chromium.org/2688393003/diff/40001/src/runtime/runtime-internal.cc#newcode369 ...
3 years, 10 months ago (2017-02-14 04:07:49 UTC) #16
miran.karic
mips lgtm, Akos no longer works on mips.
3 years, 10 months ago (2017-02-14 07:37:15 UTC) #17
vabr (Chromium)
Thanks for the review, Miran and Benedikt. I renamed the runtime method as requested. Because ...
3 years, 10 months ago (2017-02-14 10:48:20 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2688393003/80001
3 years, 10 months ago (2017-02-14 10:48:36 UTC) #21
commit-bot: I haz the power
3 years, 10 months ago (2017-02-14 11:21:42 UTC) #24
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/v8/v8/+/b478e9c11c3b01e4b34607182bab4774334...

Powered by Google App Engine
This is Rietveld 408576698