blob: e2eece98aa58be068543beef048b3d47f053f8ff [file] [log] [blame]
Ben Murdochda12d292016-06-02 14:46:10 +01001// Copyright 2012 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5(function(global, utils) {
6
7%CheckIsBootstrapping();
8
9// -------------------------------------------------------------------
10// Imports
11
12var GlobalRegExp = global.RegExp;
13var RegExpSubclassExecJS = utils.ImportNow("RegExpSubclassExecJS");
14var RegExpSubclassMatch = utils.ImportNow("RegExpSubclassMatch");
15var RegExpSubclassReplace = utils.ImportNow("RegExpSubclassReplace");
16var RegExpSubclassSearch = utils.ImportNow("RegExpSubclassSearch");
17var RegExpSubclassSplit = utils.ImportNow("RegExpSubclassSplit");
18var RegExpSubclassTest = utils.ImportNow("RegExpSubclassTest");
19var matchSymbol = utils.ImportNow("match_symbol");
20var replaceSymbol = utils.ImportNow("replace_symbol");
21var searchSymbol = utils.ImportNow("search_symbol");
22var splitSymbol = utils.ImportNow("split_symbol");
23
24utils.OverrideFunction(GlobalRegExp.prototype, "exec",
25 RegExpSubclassExecJS, true);
26utils.OverrideFunction(GlobalRegExp.prototype, matchSymbol,
27 RegExpSubclassMatch, true);
28utils.OverrideFunction(GlobalRegExp.prototype, replaceSymbol,
29 RegExpSubclassReplace, true);
30utils.OverrideFunction(GlobalRegExp.prototype, searchSymbol,
31 RegExpSubclassSearch, true);
32utils.OverrideFunction(GlobalRegExp.prototype, splitSymbol,
33 RegExpSubclassSplit, true);
34utils.OverrideFunction(GlobalRegExp.prototype, "test",
35 RegExpSubclassTest, true);
36
37})