diff --git a/lib/rules/no-array-prototype-extensions.js b/lib/rules/no-array-prototype-extensions.js index 98fb1c5f0b..8ca3b6c173 100644 --- a/lib/rules/no-array-prototype-extensions.js +++ b/lib/rules/no-array-prototype-extensions.js @@ -66,6 +66,9 @@ const KNOWN_NON_ARRAY_FUNCTION_CALLS = new Set([ // RSVP.reject 'RSVP.reject', + 'RSVP.Promise.reject', + 'Ember.RSVP.reject', + 'Ember.RSVP.Promise.reject', // *storage.clear() 'window.localStorage.clear', diff --git a/tests/lib/rules/no-array-prototype-extensions.js b/tests/lib/rules/no-array-prototype-extensions.js index c698028ff1..bb307d6aac 100644 --- a/tests/lib/rules/no-array-prototype-extensions.js +++ b/tests/lib/rules/no-array-prototype-extensions.js @@ -48,17 +48,23 @@ ruleTester.run('no-array-prototype-extensions', rule, { 'Promise.reject();', 'Promise.reject("some reason");', 'reject();', + 'this.reject();', // Global non-array class (RSVP.reject) 'RSVP.reject();', 'RSVP.reject("some reason");', + 'RSVP.Promise.reject();', + 'Ember.RSVP.reject();', + 'Ember.RSVP.Promise.reject();', // Global non-array class (*storage.clear) 'window.localStorage.clear();', 'window.sessionStorage.clear();', 'localStorage.clear();', 'sessionStorage.clear();', + 'sessionStorage?.clear();', 'clear();', + 'this.clear();', // Global non-array class (location.replace) 'window.document.location.replace(url)',