forked from lexandera/Aardwolf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmpcode.js
38 lines (30 loc) · 901 Bytes
/
tmpcode.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
'use strict';
var cheerio = require('cheerio');
var rewriter = require('./rewriter/jsrewriter.js');
function test1(){
var cheerio = require('cheerio'),
$ = cheerio.load(
'<!doctype html>\
<html lang="en">\
<head>\ </head>\ <body>\
</body>\
</html>');
var $script = $('<script></script>')
$script.text('var i="<top>";console.log(i);');
$('head').append($script);
return $.html();
}
module.exports.test1 = test1;
module.exports.testJS1 = function(){
var js = '\
if (p.attachEvent)\
for (n in {\
submit: 1,\
change: 1,\
focusin: 1\
}) m = "on" + n, o = m in p, o || (p.setAttribute(m, "return;"), o = typeof p[m] == "function"), b[n + "Bubbles"] = o;\
';
return rewriter.addDebugStatements('testfile',js).file;
}