Files
atom/native/v8_extensions/onig_reg_exp.js
2012-09-24 11:53:52 -07:00

22 lines
559 B
JavaScript

(function() {
native function buildOnigRegExp(source);
native function search(string, index);
native function test(string);
native function captureIndices(string, index, regexes);
function OnigRegExp(source) {
var regexp = buildOnigRegExp(source);
regexp.constructor = OnigRegExp;
regexp.__proto__ = OnigRegExp.prototype;
regexp.source = source;
return regexp;
}
OnigRegExp.prototype.search = search;
OnigRegExp.prototype.test = test;
OnigRegExp.captureIndices = captureIndices;
this.OnigRegExp = OnigRegExp;
})();