-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathtst.js
51 lines (41 loc) · 1.06 KB
/
tst.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(function() {
let otherAttrs = { target: "_blank" };
let a = $("<a/>", otherAttrs).attr("href", "https://semmle.com");
a.attr("rel", "noopener");
a.attr({
"data-bind": "stuff"
});
a.prop("rel", "noreferrer");
a.prop({
"data-bind": "otherstuff"
});
$.attr(a, "rel", "noopener noreferrer");
$.prop(a, "data-bind", "");
localStorage.foo = "value";
localStorage.setItem("bar", "value");
sessionStorage.foo = "value";
sessionStorage.setItem("bar", "value");
})();
(function react() {
React.createElement('div');
React.createElement('div', {toWhat: 'World'}, null)
var factory1 = React.createFactory('div');
factory1();
class Hello extends React.Component {
render() {
return <div>Hello {this.props.toWhat}</div>;
}
}
React.createElement(Hello, {toWhat: 'World'}, null)
var factory2 = React.createFactory(Hello);
factory2();
})();
(function pollute() {
class C {
foo() {
this.x; // Should not be a domValueRef
}
}
window.myApp = new C();
window.myApp.foo();
})();