diff --git a/src/validate/js/propValidators/onrender.js b/src/validate/js/propValidators/onrender.js
index 6cc31c9cc4..33693be8f1 100644
--- a/src/validate/js/propValidators/onrender.js
+++ b/src/validate/js/propValidators/onrender.js
@@ -1,3 +1,9 @@
-export default function onrender () {
+import usesThisOrArguments from '../utils/usesThisOrArguments.js';
+export default function onrender ( validator, prop ) {
+ if ( prop.value.type === 'ArrowFunctionExpression' ) {
+ if ( usesThisOrArguments( prop.value.body ) ) {
+ validator.error( `'onrender' should be a function expression, not an arrow function expression`, prop.start );
+ }
+ }
}
diff --git a/src/validate/js/propValidators/onteardown.js b/src/validate/js/propValidators/onteardown.js
index 96cce604f8..7ce61e223d 100644
--- a/src/validate/js/propValidators/onteardown.js
+++ b/src/validate/js/propValidators/onteardown.js
@@ -1,3 +1,9 @@
-export default function onteardown () {
+import usesThisOrArguments from '../utils/usesThisOrArguments.js';
+export default function onteardown ( validator, prop ) {
+ if ( prop.value.type === 'ArrowFunctionExpression' ) {
+ if ( usesThisOrArguments( prop.value.body ) ) {
+ validator.error( `'onteardown' should be a function expression, not an arrow function expression`, prop.start );
+ }
+ }
}
diff --git a/test/validator/onrender-arrow-no-this/errors.json b/test/validator/onrender-arrow-no-this/errors.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/onrender-arrow-no-this/errors.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/onrender-arrow-no-this/input.html b/test/validator/onrender-arrow-no-this/input.html
new file mode 100644
index 0000000000..c82e5c3745
--- /dev/null
+++ b/test/validator/onrender-arrow-no-this/input.html
@@ -0,0 +1,5 @@
+
diff --git a/test/validator/onrender-arrow-this/errors.json b/test/validator/onrender-arrow-this/errors.json
new file mode 100644
index 0000000000..5cc9b2c78d
--- /dev/null
+++ b/test/validator/onrender-arrow-this/errors.json
@@ -0,0 +1,8 @@
+[{
+ "message": "'onrender' should be a function expression, not an arrow function expression",
+ "pos": 29,
+ "loc": {
+ "line": 3,
+ "column": 2
+ }
+}]
diff --git a/test/validator/onrender-arrow-this/input.html b/test/validator/onrender-arrow-this/input.html
new file mode 100644
index 0000000000..e4283e60ba
--- /dev/null
+++ b/test/validator/onrender-arrow-this/input.html
@@ -0,0 +1,7 @@
+
diff --git a/test/validator/onteardown-arrow-no-this/errors.json b/test/validator/onteardown-arrow-no-this/errors.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/onteardown-arrow-no-this/errors.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/onteardown-arrow-no-this/input.html b/test/validator/onteardown-arrow-no-this/input.html
new file mode 100644
index 0000000000..a742898edb
--- /dev/null
+++ b/test/validator/onteardown-arrow-no-this/input.html
@@ -0,0 +1,5 @@
+
diff --git a/test/validator/onteardown-arrow-this/errors.json b/test/validator/onteardown-arrow-this/errors.json
new file mode 100644
index 0000000000..0596578b95
--- /dev/null
+++ b/test/validator/onteardown-arrow-this/errors.json
@@ -0,0 +1,8 @@
+[{
+ "message": "'onteardown' should be a function expression, not an arrow function expression",
+ "pos": 29,
+ "loc": {
+ "line": 3,
+ "column": 2
+ }
+}]
diff --git a/test/validator/onteardown-arrow-this/input.html b/test/validator/onteardown-arrow-this/input.html
new file mode 100644
index 0000000000..ac2f1d7e8b
--- /dev/null
+++ b/test/validator/onteardown-arrow-this/input.html
@@ -0,0 +1,7 @@
+