-
Notifications
You must be signed in to change notification settings - Fork 79
/
java2js_regexes.rtf
161 lines (160 loc) · 11.4 KB
/
java2js_regexes.rtf
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red127\green0\blue85;\red60\green60\blue60;}
{\*\expandedcolortbl;;\csgenericrgb\c49804\c0\c33333;\csgenericrgb\c23529\c23529\c23529;}
\margl1440\margr1440\vieww15160\viewh14180\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 /\\*\\* (JSON .+?) \\*/\
/\\*\\*\\n * \\1\\n * @const\\n * @type \{string\}\\n */\
\
private static final .+? \
var \
\
private static .+? \
var \
\
final .+? \
var \
\
new byte\\[([0-9*]+?)\\]\
new Uint8Array(\\1)\
\
assertNull\\((.+?)\\);\
expect(\\1).toBeNull();\
\
assertNotNull\\((.+?)\\);\
expect(\\1).not.toBeNull();\
\
assertTrue\\((.+?)\\);\
expect(\\1).toBeTruthy();\
\
assertFalse\\((.+?)\\);\
expect(\\1).toBeFalsy();\
\
assertEquals\\((.+?), (.+?)\\);\
expect(\\2).toEqual(\\1);\
\
assertArrayEquals\\((.+?), (.+?)\\)\
expect(\\2).toEqual(\\1)\
\
expect\\(Arrays\\.equals\\((.+?), (.+?)\\)\\)\\.toBeFalsy\\(\\);\
expect(\\2).not.toEqual(\\1);\
\
expect\\(JsonUtils\\.equals\\((.+?), (.+?)\\)\\)\\.toBeTruthy\\(\\);\
expect(\\2).toEqual(\\1);\
\
new JSONObject\\((.+?)\\);\
JSON.parse(\\1);\
\
([a-zA-Z0-9_]+?).toJSONString\\(\\)\
JSON.stringify(\\1)\
\
\\.get(String|JSONObject|Boolean)\\((.+?)\\)\
[\\2]\
\
\\.has\\(([a-zA-Z0-9_]+?)\\)\
[\\1]\
\
\\.put\\((.+?), (.+?)\\);\
[\\1] = \\2;\
\
([\\t ]+?)expect\\(([a-zA-Z0-9_]+)\\.remove\\((.+?)\\)\\)(.+?);\\n\
\\1expect(\\2[\\3])\\4;\\n\\1delete \\2[\\3];\\n\
\
([a-zA-Z0-9_]+?)\\.remove\\((.+?)\\);\
delete \\1[\\2];\
\
([a-zA-Z0-9_]+?)\\.get(Long|Int)\\((.+?)\\)\
parseInt(\\1[\\3])\
\
Base64Util\\.([den]+)code.*?\\(\
base64\\$\\1code(\
\
System\\.currentTimeMillis\\(\\)\
Date.now()\
\
new String\\((.+?), MslConstants\\.DEFAULT_CHARSET\\)\
textEncoding\\$getString(\\1, MslConstants\\$DEFAULT_CHARSET)\
\
([a-zA-Z0-9_]+?)\\.toString\\(\\)\\.getBytes\\(MslConstants\\.DEFAULT_CHARSET\\)\
textEncoding\\$getBytes(JSON.stringify(\\1), MslConstants\\$DEFAULT_CHARSET)\
\
([a-zA-Z0-9._]+?)\\.containsAll\\(([a-zA-Z0-9.]+?)\\)\
Arrays\\$contains(\\1, \\2)\
\
( +?)for \\(var (.+?) : (.+?)\\)\\n( +?)(.+?);\\n\
\\1\\3.forEach(function(\\2) \{\\n\\4\\5;\\n\\1\}, this);\\n\
\
\\@Test\\n( +?)public void (.+?)\\(\\) .*?\\\{\\n([a-zA-Z0-9:<>$",_\\\{\\\}\\/\\\\'\\)\\(\\]\\[\\.= ;\\n+!-]+?)\\n( +?)\\\}\\n\
it("\\2", function() \{\\n\\3\\n\\4\});\\n\
\
\\@Test\\(expected = (.+?)\\.class\\)\\n( +?)public void (.+?)\\(\\) .*?\\\{\\n([a-zA-Z0-9:<>$",_\\\{\\\}\\/\\\\'\\)\\(\\]\\[\\.= ;\\n+!-]+?)\\n( +?)\\\}\\n\
it("\\3", function() \{\\n\\2 var f = function() \{\\n\\4\\n\\5 \};\\n\\5 expect(f).toThrow(new \\1());\\n\\5\});\\n\
\
\\@MslTest\\(expected = (.+?)\\.class, mslerror = (.+?)\\)\\n( +?)public void (.+?)\\(\\) .*?\\\{\\n([a-zA-Z0-9:<>$",_\\\{\\\}\\/\\\\'/\\)\\(\\]\\[\\.= ;\\n+!-]+?)\\n( +?)\\\}\\n\
it("\\4", function() \{\\n\\3 var f = function() \{\\n\\5\\n\\6 \};\\n\\6 expect(f).toThrow(new \\1(\\2));\\n\\6\});\\n\
\
\\@MslTest\\(expected = (.+?)\\.class\\)\\n( +?)public void (.+?)\\(\\) .*?\\\{\\n([a-zA-Z0-9:<>$",_\\\{\\\}\\/\\\\'\\)\\(\\]\\[\\.= ;\\n+!-]+?)\\n( +?)\\\}\\n\
it("\\3", function() \{\\n\\2 var f = function() \{\\n\\4\\n\\5 \};\\n\\5 expect(f).toThrow(new \\1(MslError.NONE));\\n\\5\});\\n\
\
\\@MslTest\\(expected = (.+?)\\.class, messageid = (.+?)\\)\\n( +?)public void (.+?)\\(\\) .*?\\\{\\n([a-zA-Z0-9:<>$",_\\\{\\\}\\/\\\\'\\)\\(\\]\\[\\.= ;\\n+!-]+?)\\n( +?)\\\}\\n\
it("\\4", function() \{\\n\\3 var f = function() \{\\n\\5\\n\\6 \};\\n\\6 expect(f).toThrow(new \\1(MslError.NONE), \\2);\\n\\6\});\\n\
\
([\\t ]+?)var (.+?) = (.+?(Token|Header|Chunk|Data)\\$(create|parse))\\((.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3(\\6, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = new (Message.+?Stream\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 timeout: function() \{ throw new Error("Timed out waiting for \\2."); \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = (MessageBuilder\\$createRequest)\\((.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3(\\4, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = (MessageBuilder\\$create.*?Response)\\((.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3(\\4, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = ((.+?uilder\\$getHeader|Header\\$parseHeader)\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)(.*?(Token|Header|Chunk)\\$(create|parseHeader).+?)\\);\
\\1\\2, \{\\n\\1 result: function() \{\},\\n\\1 error: function(err) \{ exception = err; \},\\n\\1\});\
\
([\\t ]+?)(expect\\(f\\)\\.toThrow\\(.+?\\);)\
\\1runs(function() \{\\n\\1 var f = function() \{ throw exception; \};\\n\\1 \\2\\n\\1\});\
\
([\\t ]+?)var (.+?) = (MslTestUtils\\.get.*?Tokens?\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(t) \{ \\2 = t; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = (.+?\\.getEntityAuthenticationData\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
\pard\pardeftab720\partightenfactor0
\cf0 ([\\t ]+?)var (.+?) = new MockMslContext\\((.+?)\\);\
\\1var \\2;\\n\\1beforeEach(function() \{\\n\\1 if (!\\2) \{\\n\\1 runs(function() \{\\n\\1 MockMslContext\\$create(\\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1 \});\\n\\1 waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\\n\\1 \}\\n\\1\});\
\
([\\t ]+?)var (.+?) = new (MslCiphertextEnvelope|MslSignatureEnvelope)\\((.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3\\$create(\\4, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = (MslCiphertextEnvelope|MslSignatureEnvelope)\\.parse\\((.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3\\$parse(\\4, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
([\\t ]+?)var (.+?) = (factory.(generateResponse|getCryptoContext)\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = (.+?\\.(encrypt|decrypt|sign|verify|wrap|unwrap)\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(data) \{ \\2 = data; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+)(.+?\\.(encrypt|decrypt|sign|verify|wrap|unwrap)\\(.+?)\\);\
\\1var exception;\\n\\1runs(function() \{\\n\\1 \\2, \{\\n\\1 result: function() \{\},\\n\\1 error: function(e) \{ exception = e; \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return exception; \}, "exception", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)var (.+?) = ((ResponseData|KeyResponseData|RequestData|KeyRequestData)\\$parse\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(data) \{ \\2 = data; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);\
\
([\\t ]+?)expect\\((.+?(add|exclude|del).+?Token\\(.+?)\\)\\).(toBe.+?);\
\\1var \\3;\\n\\1runs(function() \{\\n\\1 \\2, \{\\n\\1 result: function(b) \{ \\3 = b; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\3 !== undefined; \}, "\\3", 100);\\n\\1runs(function() \{ expect(\\3).\\4; \});\
\
([\\t ]+?)expect\\((builder\\.willEncrypt(.+?)\\()\\)\\)\\.(toBe.+?);\
\\1var encrypt\\3;\\n\\1runs(function() \{\\n\\1 \\2\{\\n\\1 result: function(b) \{ encrypt\\3 = b; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return encrypt\\3 !== undefined; \}, "encrypt\\3", MslTestConstants.TIMEOUT);\\n\\1runs(function() \{ expect(encrypt\\3).\\4; \});\
\
([\\t ]+)var (.+?) = (generateInputStream\\(.+?)\\);\
\\1var \\2;\\n\\1runs(function() \{\\n\\1 \\3, \{\\n\\1 result: function(x) \{ \\2 = x; \},\\n\\1 error: function(e) \{ expect(\cf2 function\cf0 ()\cf3 \cf0 \{\cf3 \cf2 throw\cf3 \cf0 e;\cf3 \cf0 \}).not.toThrow(); \}\\n\\1 \});\\n\\1\});\\n\\1waitsFor(function() \{ return \\2; \}, "\\2", MslTestConstants.TIMEOUT);}