Skip to content

Commit 0410669

Browse files
committed
disallow selection.style as a getter in strict-d3
1 parent ef0bf88 commit 0410669

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/image/strict-d3.js

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ selProto.style = function() {
3232

3333
if(sel.size()) {
3434
if(typeof obj === 'string') {
35+
if(arguments.length === 1) {
36+
throw new Error('d3 selection.style called as getter: ' +
37+
'disallowed as it can fail for unattached elements');
38+
}
3539
checkStyleVal(sel, obj, arguments[1]);
3640
} else {
3741
Object.keys(obj).forEach(function(key) { checkStyleVal(sel, key, obj[key]); });

0 commit comments

Comments
 (0)