summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/stencil-asmjs.js
blob: 0379fa05ebeeba170e80d43c167f90ce588bb8fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |jit-test| skip-if: isLcovEnabled()

let source = `
  var m = function() {
    "use asm"
    function g(){}
    return g;
  }

  function check() {
    var objM = new m;
    var g = m();
    // g is a ctor returning an primitive value, thus an empty object
    assertEq(Object.getOwnPropertyNames(new g).length, 0);
  }

  check()
`;

// Check that on-demand delazification and concurrent delazification are not
// attempting to parse "use asm" functions.
const options = {
    fileName: "tests/asm.js/testBug999790.js",
    lineNumber: 1,
    eagerDelazificationStrategy: "CheckConcurrentWithOnDemand",
    newContext: true,
};
evaluate(source, options);