From b5ff2603538ded91d4e2f0c3854e753d9e75b172 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Wed, 6 Jun 2018 14:32:34 -0300 Subject: [PATCH] Add refs.* to valid event handler callees warning 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 1b33b3e786..df499a9fd5 100644 --- a/src/validate/html/validateEventHandler.ts +++ b/src/validate/html/validateEventHandler.ts @@ -43,7 +43,7 @@ export default function validateEventHandlerCallee( return; } - const validCallees = ['this.*', 'event.*', 'options.*', 'console.*'].concat( + const validCallees = ['this.*', 'refs.*', 'event.*', 'options.*', '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 b463045538..d1999de882 100644 --- a/test/validator/samples/method-nonexistent-helper/warnings.json +++ b/test/validator/samples/method-nonexistent-helper/warnings.json @@ -1,6 +1,6 @@ [{ "code": "invalid-callee", - "message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, 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.*, refs.*, event.*, options.*, console.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", "pos": 18, "start": { "line": 1, diff --git a/test/validator/samples/method-nonexistent/warnings.json b/test/validator/samples/method-nonexistent/warnings.json index 3ad9ee8734..d0a30ab928 100644 --- a/test/validator/samples/method-nonexistent/warnings.json +++ b/test/validator/samples/method-nonexistent/warnings.json @@ -1,6 +1,6 @@ [{ "code": "invalid-callee", - "message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire, destroy or bar)", + "message": "'foo' is an invalid callee (should be one of this.*, refs.*, event.*, options.*, console.*, set, fire, destroy or bar)", "pos": 18, "start": { "line": 1, diff --git a/test/validator/samples/window-event-invalid/warnings.json b/test/validator/samples/window-event-invalid/warnings.json index 1d20c8fac9..2e403fe27b 100644 --- a/test/validator/samples/window-event-invalid/warnings.json +++ b/test/validator/samples/window-event-invalid/warnings.json @@ -1,6 +1,6 @@ [{ "code": "invalid-callee", - "message": "'resize' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire or destroy)", + "message": "'resize' is an invalid callee (should be one of this.*, refs.*, event.*, options.*, console.*, set, fire or destroy)", "start": { "line": 1, "column": 26,