github.com/igggame/nebulas-go@v2.1.0+incompatible/nf/nvm/test/test_oom_4.js (about)

     1  'use strict';
     2  
     3  var SampleContract = function () {
     4      LocalContractStorage.defineProperties(this, {
     5          name: null,
     6          count: null
     7      });
     8      LocalContractStorage.defineMapProperty(this, "allocation");
     9  };
    10  
    11  SampleContract.prototype = {
    12      init: function (mem) {
    13          var c = new ArrayBuffer(mem);
    14          console.log("c[1]:", c[1]);
    15      },
    16      newMem: function (mem) {
    17          var c = new ArrayBuffer(mem);
    18          console.log("c[1]:", c[1]);
    19      },
    20      loop: function(){
    21          var a = 0;
    22          while(true){
    23              a +=1;
    24          };
    25          return a;
    26      },
    27  };
    28  
    29  module.exports = SampleContract;