| 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | var gTestfile = 'regress-28686.js'; |
| 8 | |
| 9 | test(); |
| 10 | |
| 11 | function test() |
| 12 | { |
| 13 | enterFunc ("test"); |
| 14 | |
| 15 | printBugNumber (28686); |
| 16 | |
| 17 | var str = 'foo "bar" baz'; |
| 18 | reportCompare ('foo \\"bar\\" baz', str.replace(/([\'\"])/g, "\\$1"), |
| 19 | "str.replace failed."); |
| 20 | |
| 21 | exitFunc ("test"); |
| 22 | |
| 23 | } |