From 4564b9a04b593c68d6ae3ee8fb83deb06fc28ca4 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 18 Sep 2017 20:59:51 -0400 Subject: [PATCH] update validation message --- src/validate/html/validateEventHandler.ts | 2 +- test/validator/samples/method-nonexistent-helper/warnings.json | 2 +- test/validator/samples/method-nonexistent/warnings.json | 2 +- test/validator/samples/window-event-invalid/warnings.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/validate/html/validateEventHandler.ts b/src/validate/html/validateEventHandler.ts index 6f571806fe..9a22bdd6c8 100644 --- a/src/validate/html/validateEventHandler.ts +++ b/src/validate/html/validateEventHandler.ts @@ -34,7 +34,7 @@ export default function validateEventHandlerCallee( ) return; - const validCallees = ['this.*', 'event.*'].concat( + const validCallees = ['this.*', 'event.*', 'console.*'].concat( Array.from(validBuiltins), Array.from(validator.methods.keys()) ); diff --git a/test/validator/samples/method-nonexistent-helper/warnings.json b/test/validator/samples/method-nonexistent-helper/warnings.json index 02512426a1..d090c4df94 100644 --- a/test/validator/samples/method-nonexistent-helper/warnings.json +++ b/test/validator/samples/method-nonexistent-helper/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'foo' is an invalid callee (should be one of this.*, event.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", + "message": "'foo' is an invalid callee (should be one of this.*, event.*, console.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", "pos": 18, "loc": { "line": 1, diff --git a/test/validator/samples/method-nonexistent/warnings.json b/test/validator/samples/method-nonexistent/warnings.json index 8debbf8132..d8f4e0e0cf 100644 --- a/test/validator/samples/method-nonexistent/warnings.json +++ b/test/validator/samples/method-nonexistent/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'foo' is an invalid callee (should be one of this.*, event.*, set, fire, destroy or bar)", + "message": "'foo' is an invalid callee (should be one of this.*, event.*, console.*, set, fire, destroy or bar)", "pos": 18, "loc": { "line": 1, diff --git a/test/validator/samples/window-event-invalid/warnings.json b/test/validator/samples/window-event-invalid/warnings.json index 425c657cb1..20dc4c79fa 100644 --- a/test/validator/samples/window-event-invalid/warnings.json +++ b/test/validator/samples/window-event-invalid/warnings.json @@ -1,5 +1,5 @@ [{ - "message": "'resize' is an invalid callee (should be one of this.*, event.*, set, fire or destroy)", + "message": "'resize' is an invalid callee (should be one of this.*, event.*, console.*, set, fire or destroy)", "loc": { "line": 1, "column": 20