diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index e1b8625f2f48..5d11d17a2877 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -144,7 +144,7 @@ if CONFIG['NIGHTLY_BUILD']: 'testErrorInterceptor.cpp', ] -if CONFIG['JS_BUILD_BINAST'] and CONFIG['JS_STANDALONE'] and CONFIG['OS_TARGET'] != 'WINNT': +if CONFIG['JS_BUILD_BINAST'] and CONFIG['JS_STANDALONE']: # Standalone builds leave the source directory untouched, # which lets us run tests with the data files intact. # Otherwise, in the current state of the build system, diff --git a/js/src/jsapi-tests/testBinASTReader.cpp b/js/src/jsapi-tests/testBinASTReader.cpp index 35c0dd99d8e1..f6ceebf431f2 100644 --- a/js/src/jsapi-tests/testBinASTReader.cpp +++ b/js/src/jsapi-tests/testBinASTReader.cpp @@ -81,11 +81,17 @@ runTestFromPath(JSContext* cx, const char* path) #elif defined(XP_WIN) MOZ_ASSERT(path[pathlen - 1] == '\\'); - const char PATTERN[] = "*"; + Vector pattern(cx); + if (!pattern.append(path, pathlen)) + MOZ_CRASH(); + if (!pattern.append('*')) + MOZ_CRASH(); + if (!pattern.append('\0')) + MOZ_CRASH(); WIN32_FIND_DATA FindFileData; enterJsDirectory(); - HANDLE hFind = FindFirstFile(PATTERN, &FindFileData); + HANDLE hFind = FindFirstFile(pattern.begin(), &FindFileData); exitJsDirectory(); for (bool found = (hFind != INVALID_HANDLE_VALUE); found;