JavaScript: Add basic modelling of React Native WebViews.

This commit is contained in:
Max Schaefer
2018-08-10 13:12:06 +01:00
parent 355302eac4
commit 3ce82aff02
4 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
/**
* Provides classes for working with [React Native](https://facebook.github.io/react-native) code.
*/
import javascript
module ReactNative {
/** A `WebView` JSX element. */
class WebViewElement extends DataFlow::ValueNode, DataFlow::DefaultSourceNode {
override JSXElement astNode;
WebViewElement() {
DataFlow::moduleMember("react-native", "WebView").flowsToExpr(astNode.getNameExpr())
}
}
}

View File

@@ -0,0 +1 @@
| webview.js:6:12:6:56 | <WebVie ... om'}}/> |

View File

@@ -0,0 +1,4 @@
import javascript
from ReactNative::WebViewElement wv
select wv

View File

@@ -0,0 +1,8 @@
import { Component } from 'react';
import { WebView } from 'react-native';
class LgtmView extends Component {
render() {
return <WebView source={{uri: 'https://lgtm.com'}}/>;
}
}