js/src/jit-test/tests/ion/bug799185-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/bug799185-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +function test(aLauncher) {
     1.5 +    var result = null;
     1.6 +
     1.7 +    let prefs = 0;
     1.8 +    let bundle = 1;
     1.9 +
    1.10 +    if (!bundle) {
    1.11 +      // Check to see if the user wishes to auto save to the default download
    1.12 +      // folder without prompting. Note that preference might not be set.
    1.13 +      let autodownload = false;
    1.14 +      try {
    1.15 +        autodownload = !!autodownload;
    1.16 +      } catch (e) { }
    1.17 +
    1.18 +      if (autodownload) {
    1.19 +        // Retrieve the user's default download directory
    1.20 +        let dnldMgr = 2;
    1.21 +        let defaultFolder = 3;
    1.22 +
    1.23 +        try {
    1.24 +          result = 42;
    1.25 +        }
    1.26 +        catch (ex) {
    1.27 +          if (result == 12) {
    1.28 +            let prompter = 4;
    1.29 +            return;
    1.30 +          }
    1.31 +        }
    1.32 +
    1.33 +        // Check to make sure we have a valid directory, otherwise, prompt
    1.34 +        if (result)
    1.35 +          return result;
    1.36 +      }
    1.37 +    }
    1.38 +
    1.39 +    // Use file picker to show dialog.
    1.40 +    var picker = 0;
    1.41 +    if (picker) {
    1.42 +      // aSuggestedFileExtension includes the period, so strip it
    1.43 +      picker = 1;
    1.44 +    }
    1.45 +    else {
    1.46 +      try {
    1.47 +        picker = aLauncher.MIMEInfo.primaryExtension;
    1.48 +      }
    1.49 +      catch (ex) { }
    1.50 +    }
    1.51 +    return result;
    1.52 +  }
    1.53 +
    1.54 +test({});

mercurial