bobbystacksmash / Construct

A cross-platform Windows Script Host emulator for dynamically analysing malicious JScript programs.
GNU General Public License v3.0
8 stars 2 forks source link

FSO.FolderExists does not throw correct exception #10

Open bobbystacksmash opened 5 years ago

bobbystacksmash commented 5 years ago

This snippet of code is part of the FSO.FolderExists() method which is not throwing the correct WINAPI exception when the dirpath is not a valid type - it throws a node.js exception about .toString() not being defined for dirpath.

if (typeof dirpath !== "string") {
  try {
    dirpath = dirpath.toString();
  }
  catch (e) {
    throw e;
  }
}