Skip to content

Commit 440ca0d

Browse files
committed
throw error when setting transform attrs with NaNs
1 parent 59405d8 commit 440ca0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/image/strict-d3.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ function checkAttrVal(sel, key, val) {
5858
if(/--/.test(val) && isNumeric(val.split('--')[1].charAt(0))) {
5959
throw new Error('d3 selection.attr called with value ' + val + ' which includes a double negative');
6060
}
61+
62+
if(/transform/.test(key) && /NaN/.test(val)) {
63+
throw new Error('d3 selection.attr called with ' + key + ' ' + val + ' containing a NaN');
64+
}
6165
}
6266

6367
function checkStyleVal(sel, key, val) {

0 commit comments

Comments
 (0)