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

Issue 2100403002: calling whenDefined with invalid name should throw SyntaxError (Closed)

Created:
4 years, 5 months ago by davaajav
Modified:
4 years, 2 months ago
Reviewers:
kojii, yosin_UTC9
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

calling whenDefined with invalid name should throw SyntaxError Added test for customElements.whenDefined Returns a promise rejected with a "SyntaxError" DOMException if not given a valid custom element name. BUG=594918 Committed: https://crrev.com/f84387506d8ac7d7993bca26d83385460f38d2e7 Cr-Commit-Position: refs/heads/master@{#404117}

Patch Set 1 #

Total comments: 1

Patch Set 2 : replaced new SyntacError() with 'SYNTAX_ERR' #

Patch Set 3 : adding promise_rejects_with_dom_exception_syntax_error #

Total comments: 3

Patch Set 4 : patch update #

Patch Set 5 : patch update #

Patch Set 6 : delete unnecessary files #

Patch Set 7 : patch update #

Patch Set 8 : removing assert_throws_dom_exception #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -13 lines) Patch
M third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html View 1 2 3 4 5 6 2 chunks +38 lines, -0 lines 4 comments Download
M third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html View 1 2 3 4 5 6 7 1 chunk +0 lines, -13 lines 0 comments Download
M third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (8 generated)
davaajav
Please take a look
4 years, 5 months ago (2016-06-28 00:36:42 UTC) #2
davaajav
PTL
4 years, 5 months ago (2016-06-28 02:41:54 UTC) #4
kojii
https://codereview.chromium.org/2100403002/diff/1/third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html File third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html (right): https://codereview.chromium.org/2100403002/diff/1/third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html#newcode35 third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html:35: return promise_rejects(t, new SyntaxError(), w.customElements.whenDefined(name)); s/new SyntaxError()/'SYNTAX_ERR'/ "new SyntaxError()" ...
4 years, 5 months ago (2016-06-28 04:26:00 UTC) #5
davaajav
Replaced new SyntaxError() on line 35 with 'SYNTAX_ERR'
4 years, 5 months ago (2016-06-28 05:08:11 UTC) #6
davaajav
PTL Wrapped up things a bit. The commented out return statement on line 40 makes ...
4 years, 5 months ago (2016-06-29 03:44:36 UTC) #7
kojii
Isn't the change to custom-elements-helpers.js (to add "return") needed? https://codereview.chromium.org/2100403002/diff/40001/third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html File third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html (right): https://codereview.chromium.org/2100403002/diff/40001/third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html#newcode4 third_party/WebKit/LayoutTests/custom-elements/spec/when-defined-invalid-name.html:4: ...
4 years, 5 months ago (2016-06-29 03:57:41 UTC) #8
davaajav
PTL
4 years, 5 months ago (2016-06-29 04:05:34 UTC) #9
kojii
Isn't the change to custom-elements-helpers.js (to add "return") needed?
4 years, 5 months ago (2016-06-29 04:33:25 UTC) #10
davaajav
On 2016/06/29 at 04:33:25, kojii wrote: > Isn't the change to custom-elements-helpers.js (to add "return") ...
4 years, 5 months ago (2016-06-29 04:43:14 UTC) #11
davaajav
On 2016/06/29 at 04:43:14, davaajav wrote: > On 2016/06/29 at 04:33:25, kojii wrote: > > ...
4 years, 5 months ago (2016-06-29 04:45:37 UTC) #12
kojii
On 2016/06/29 at 04:45:37, davaajav wrote: > On 2016/06/29 at 04:43:14, davaajav wrote: > > ...
4 years, 5 months ago (2016-06-29 04:48:23 UTC) #13
davaajav
PTL
4 years, 5 months ago (2016-07-06 07:46:57 UTC) #15
kojii
lgtm
4 years, 5 months ago (2016-07-07 07:48:03 UTC) #17
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/2100403002/140001
4 years, 5 months ago (2016-07-07 07:48:15 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/251311)
4 years, 5 months ago (2016-07-07 08:15:34 UTC) #20
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/2100403002/140001
4 years, 5 months ago (2016-07-07 08:23:53 UTC) #22
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 5 months ago (2016-07-07 10:25:57 UTC) #23
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-07 10:26:08 UTC) #24
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/f84387506d8ac7d7993bca26d83385460f38d2e7 Cr-Commit-Position: refs/heads/master@{#404117}
4 years, 5 months ago (2016-07-07 10:27:39 UTC) #26
yosin_UTC9
4 years, 2 months ago (2016-09-21 09:42:31 UTC) #28
Message was sent while issue was closed.
Tools for simple code:

String template: `literal ${expression}`
Lambda short cut: (x) => { return foo(); } == x => foo()
No-ambiguos unicode literal: \u{...}

https://codereview.chromium.org/2100403002/diff/140001/third_party/WebKit/Lay...
File
third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html
(right):

https://codereview.chromium.org/2100403002/diff/140001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html:65:
let invalid_names = [
nit: s/let/const/

https://codereview.chromium.org/2100403002/diff/140001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html:82:
'bad-\ufffe', 'bad-\uffff', 'bad-' + String.fromCodePoint(0xf0000)
You can write as 'bad-\u{F0000}'.

https://codereview.chromium.org/2100403002/diff/140001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html:89:
return promise_rejects_with_dom_exception_syntax_error(w, t,
w.customElements.whenDefined(name));
You can write as below:
.then(w => promise_rejects_with_dom_exception_syntax_error(w, t,
w.customElements.whenDefined(name))

https://codereview.chromium.org/2100403002/diff/140001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/custom-elements/spec/custom-elements-registry/when_defined.html:91:
}, 'whenDefined() called with invalid name ' + name + ' should throw
"SyntaxError"DOMException');
You can write as below:
`whenDefined() called with invalid name '${name} should throw
"SyntaxError"DOMException'

String template, using backquote instead of single/double quote, is easier to
read.

Powered by Google App Engine
This is Rietveld 408576698