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

Issue 1301423004: bindings: Makes the default receiver of callbacks "undefined". (Closed)

Created:
5 years, 3 months ago by Yuki
Modified:
5 years, 3 months ago
Reviewers:
haraken, Jens Widell
CC:
blink-reviews, vivekg, blink-reviews-bindings_chromium.org, vivekg_samsung
Target Ref:
refs/remotes/origin/master
Project:
blink
Visibility:
Public.

Description

bindings: Makes the default receiver of callbacks "undefined". http://heycam.github.io/webidl/#es-invoking-callback-functions By default, "the callback this value" should be "undefined". In strict mode, - before: this value was window (global object). - after: this value is undefined In non-strict mode, undefined (or null) this value is converted to the global object. This conversion is done in V8. So user script observes no change. See http://www.ecma-international.org/ecma-262/5.1/#sec-10.4.3 Note: This CL changes the callback this value from the window object of the receiver to the global object of the running script. Example) Suppose running the following script in a child window. function f() { console.log(this); } top.requestAnimationFrame(f); before: this === top after: this === window (child window) BUG=332663 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201482

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -10 lines) Patch
M Source/bindings/templates/callback_interface.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestCallbackInterface.cpp View 9 chunks +9 lines, -9 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Yuki
Could you review this CL?
5 years, 3 months ago (2015-08-31 07:19:19 UTC) #2
haraken
On 2015/08/31 07:19:19, Yuki wrote: > Could you review this CL? Would you describe the ...
5 years, 3 months ago (2015-08-31 07:33:09 UTC) #3
Jens Widell
LGTM One thing I'd check is whether which global object becomes this changes in a ...
5 years, 3 months ago (2015-08-31 07:35:46 UTC) #5
Yuki
Firefox supports "use strict" and |this| becomes undefined. IE doesn't support it well and |this| ...
5 years, 3 months ago (2015-08-31 10:17:04 UTC) #6
haraken
On 2015/08/31 10:17:04, Yuki wrote: > Firefox supports "use strict" and |this| becomes undefined. > ...
5 years, 3 months ago (2015-08-31 10:32:04 UTC) #7
Jens Widell
On 2015/08/31 10:17:04, Yuki wrote: > Old Blink: this => the top window > This ...
5 years, 3 months ago (2015-08-31 10:45:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1301423004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301423004/1
5 years, 3 months ago (2015-08-31 11:59:35 UTC) #10
commit-bot: I haz the power
5 years, 3 months ago (2015-08-31 12:50:29 UTC) #11
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://src.chromium.org/viewvc/blink?view=rev&revision=201482

Powered by Google App Engine
This is Rietveld 408576698