diff --git a/lib/to_string.cc b/lib/to_string.cc index 243d128..b246ca5 100644 --- a/lib/to_string.cc +++ b/lib/to_string.cc @@ -32,6 +32,10 @@ NAN_METHOD(WrappedRE2::ToString) { buffer += "m"; } + if (re2->dotAll) + { + buffer += "s"; + } buffer += "u"; if (re2->sticky) { diff --git a/tests/test_toString.js b/tests/test_toString.js index 90e3611..1483b0a 100644 --- a/tests/test_toString.js +++ b/tests/test_toString.js @@ -23,6 +23,7 @@ unit.add(module, [ eval(t.TEST("RE2('^a{2,}', 'mi') + '' === '/^a{2,}/imu'")); eval(t.TEST("RE2('^a{5}$', 'gim') + '' === '/^a{5}$/gimu'")); eval(t.TEST("RE2('\\\\u{1F603}/', 'iy') + '' === '/\\\\u{1F603}\\\\//iuy'")); + eval(t.TEST("RE2('^a{2,}', 'smi') + '' === '/^a{2,}/imsu'")); eval(t.TEST("RE2('c', 'ug').toString() === '/c/gu'")); eval(t.TEST("RE2('d', 'um').toString() === '/d/mu'"));