From b9c80b8728ac3ff6335e4b586fc8d159962b9424 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 23 Nov 2017 10:16:37 -0500 Subject: [PATCH] test that events is an object literal --- src/validate/js/propValidators/events.ts | 1 - .../samples/events-non-object-literal/errors.json | 8 ++++++++ .../samples/events-non-object-literal/input.html | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/validator/samples/events-non-object-literal/errors.json create mode 100644 test/validator/samples/events-non-object-literal/input.html diff --git a/src/validate/js/propValidators/events.ts b/src/validate/js/propValidators/events.ts index 1bbf75d1e6..0f81fd7f4d 100644 --- a/src/validate/js/propValidators/events.ts +++ b/src/validate/js/propValidators/events.ts @@ -9,7 +9,6 @@ export default function events(validator: Validator, prop: Node) { `The 'events' property must be an object literal`, prop.start ); - return; } checkForDupes(validator, prop.value.properties); diff --git a/test/validator/samples/events-non-object-literal/errors.json b/test/validator/samples/events-non-object-literal/errors.json new file mode 100644 index 0000000000..b0ff728675 --- /dev/null +++ b/test/validator/samples/events-non-object-literal/errors.json @@ -0,0 +1,8 @@ +[{ + "message": "The 'events' property must be an object literal", + "loc": { + "line": 3, + "column": 2 + }, + "pos": 29 +}] \ No newline at end of file diff --git a/test/validator/samples/events-non-object-literal/input.html b/test/validator/samples/events-non-object-literal/input.html new file mode 100644 index 0000000000..51f0940c17 --- /dev/null +++ b/test/validator/samples/events-non-object-literal/input.html @@ -0,0 +1,5 @@ + \ No newline at end of file