js: remove duplicating injection pattern, cleanup
authorKonstantin Ulitin <konstantin.ulitin@jetbrains.com>
Wed, 23 Sep 2020 09:51:42 +0000 (11:51 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 23 Sep 2020 09:58:45 +0000 (09:58 +0000)
GitOrigin-RevId: 727a1e922d15dae7f90cbfc8304416191c1782c5

flex/flex-tests/testData/flex_highlighting/SqlInjection.mxml [deleted file]
flex/flex-tests/testData/flex_highlighting/SqlInjection1.as
flex/flex-tests/testSrc/com/intellij/flex/highlighting/FlexHighlightingTest.java
vuejs/src/org/jetbrains/vuejs/codeInsight/refs/VueJSReferenceContributor.kt
vuejs/src/org/jetbrains/vuejs/libraries/vuex/codeInsight/VuexPatterns.kt

diff --git a/flex/flex-tests/testData/flex_highlighting/SqlInjection.mxml b/flex/flex-tests/testData/flex_highlighting/SqlInjection.mxml
deleted file mode 100644 (file)
index edf90b4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
-  <mx:Script>
-    public function f(dbStatement, statement, st) {
-      dbStatement.text = "SELECT * FROM FROM <error>FROM</error>";
-      statement.text = "SELECT * FROM FROM <error>FROM</error>";
-      st.text = "SELECT * FROM FROM <error>FROM</error>";
-    }
-  </mx:Script>
-</mx:Application>
\ No newline at end of file
index b65492af391397b2ae71581df7bf0d2f885e9a00..ff1fe38466339fc972c19032663587723d1953d2 100644 (file)
@@ -8,10 +8,5 @@ class SqlInjection1 {
         d.text = "SELECT * FROM<error> </error>";
         var a = d;
         a.text = "SELECT * FROM<error> </error>";
-        var c = new SqlInjection1();
-        c.text = "SELECT * FROM";
-        statement.text = "SELECT * FROM<error> </error>";
-        st.text = "SELECT * FROM<error> </error>";
-        p.text = "SELECT * FROM ";
     }
 }
\ No newline at end of file
index eb978adf533b822da022f140610fb3215521c085..415304371072c14aac82dab808e5b4681dd802cd 100644 (file)
@@ -1824,11 +1824,6 @@ public class FlexHighlightingTest extends ActionScriptDaemonAnalyzerTestCase {
     invokeNamedActionWithExpectedFileCheck(testName + "_2", "OverrideMethods", "as");
   }
 
-  /*@JSTestOptions({JSTestOption.WithoutWarnings, JSTestOption.WithFlexSdk})
-  public void testSqlInjection() throws Exception {
-    doTestFor(false, getTestName(false) + ".mxml");
-  }*/
-
   @JSTestOptions({JSTestOption.WithoutWarnings, JSTestOption.WithFlexSdk})
   public void testSqlInjection1() {
     doTestFor(false, getTestName(false) + ".as");
index 3b9367d51d726b8616fd2b21577f60dec7446b01..da8cf91ec12a397301d9e4795a7948cd4462324e 100644 (file)
@@ -42,7 +42,7 @@ class VueJSReferenceContributor : PsiReferenceContributor() {
   companion object {
     private val THIS_INSIDE_COMPONENT: ElementPattern<out PsiElement> = createThisInsideComponentPattern()
     private val COMPONENT_NAME: ElementPattern<out PsiElement> = createComponentNamePattern()
-    private val TEMPLATE_ID_REF = JSPatterns.jsLiteralExpression()
+    private val TEMPLATE_ID_REF = JSPatterns.jsLiteral()
       .withParent(JSPatterns.jsProperty().withName(TEMPLATE_PROP))
 
     private fun createThisInsideComponentPattern(): ElementPattern<out PsiElement> {
index cfff7101d690493121cf72d77fb631bb62d28fa1..ce6dfbf499a233893722095abbe88b6f6e8f7e57 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package org.jetbrains.vuejs.libraries.vuex.codeInsight
 
-import com.intellij.lang.javascript.patterns.JSElementPattern
+import com.intellij.lang.javascript.patterns.JSLiteralExpressionPattern
 import com.intellij.lang.javascript.patterns.JSPatterns
 import com.intellij.lang.javascript.psi.*
 import com.intellij.lang.javascript.psi.ecma6.ES6Decorator
@@ -66,8 +66,8 @@ object VuexPatterns {
       .withAncestor(4, PlatformPatterns.psiElement(JSCallExpression::class.java)
         .withFirstChild(JSPatterns.jsReferenceExpression().withReferenceNames(COMMIT, DISPATCH)))
 
-  val VUEX_INDEXED_ACCESS_LITERAL: JSElementPattern.Capture<JSLiteralExpression> =
-    JSPatterns.jsLiteralExpression()
+  val VUEX_INDEXED_ACCESS_LITERAL: JSLiteralExpressionPattern =
+    JSPatterns.jsLiteral()
       .withParent(PlatformPatterns.psiElement(JSIndexedPropertyAccessExpression::class.java)
                     .withFirstChild(JSPatterns.jsReferenceExpression().withReferenceNames(GETTERS, ROOT_GETTERS, STATE, ROOT_STATE)))
 }