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

Issue 814683002: Custom elements should have class side inheritance. (Closed)

Created:
6 years ago by esprehn
Modified:
6 years ago
CC:
mojo-reviews_chromium.org, ojan, abarth-chromium
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Custom elements should have class side inheritance. We were not setting the __proto__ property of the generated constructor so the generated class didn't inherit from the passed class which meant that statics were not available. This patch adds the missing call to setPrototype (which sets __proto__). R=eseidel@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/88487174d62376e7a9365d3e1192673618b0ba6e

Patch Set 1 #

Patch Set 2 : better test name. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -1 line) Patch
M sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp View 2 chunks +5 lines, -1 line 0 comments Download
A sky/tests/custom-elements/generated-constructor.sky View 1 1 chunk +18 lines, -0 lines 2 comments Download
A sky/tests/custom-elements/generated-constructor-expected.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
eseidel
lgtm
6 years ago (2014-12-17 22:23:41 UTC) #2
esprehn
Committed patchset #2 (id:20001) manually as 88487174d62376e7a9365d3e1192673618b0ba6e (presubmit successful).
6 years ago (2014-12-17 22:24:38 UTC) #3
arv (Not doing code reviews)
https://codereview.chromium.org/814683002/diff/20001/sky/tests/custom-elements/generated-constructor.sky File sky/tests/custom-elements/generated-constructor.sky (right): https://codereview.chromium.org/814683002/diff/20001/sky/tests/custom-elements/generated-constructor.sky#newcode7 sky/tests/custom-elements/generated-constructor.sky:7: class TestElementClass { Don't you need extends HTMLElement as ...
6 years ago (2014-12-17 22:29:43 UTC) #5
esprehn
6 years ago (2014-12-17 22:59:31 UTC) #6
Message was sent while issue was closed.
On 2014/12/17 at 22:29:43, arv wrote:
>
https://codereview.chromium.org/814683002/diff/20001/sky/tests/custom-element...
> File sky/tests/custom-elements/generated-constructor.sky (right):
> 
>
https://codereview.chromium.org/814683002/diff/20001/sky/tests/custom-element...
> sky/tests/custom-elements/generated-constructor.sky:7: class TestElementClass
{
> Don't you need extends HTMLElement as well?
> 
>
https://codereview.chromium.org/814683002/diff/20001/sky/tests/custom-element...
> sky/tests/custom-elements/generated-constructor.sky:14:
assert.equal(TestElement.test(), 10);
> Maybe add:
> 
> assert.equal(Object.getPrototypeOf(TestElement), TestElementClass);

Fixed in https://codereview.chromium.org/809183002

Powered by Google App Engine
This is Rietveld 408576698