jsengine 1.0.1 copy "jsengine: ^1.0.1" to clipboard
jsengine: ^1.0.1 copied to clipboard

outdated

JS engine for Dart.

example/example.dart

import 'package:jsparser/jsparser.dart';
import 'package:jsengine/jsengine.dart';

main() {
  var jsengine = new JSEngine();

  var program = parsejs("""
  function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}

Car.prototype.info = function(i) {
  return i+' You are driving a ' + this.year + ' ' + this.make + ' ' + this.model + '.';
};

  var car1 = new Car('Eagle', 'Talon TSi', 1993);
  """, filename: 'car.js');

  jsengine.visitProgram(program);

  for(var i =0 ; i< 100000; i++){
    var program2 = parsejs("""car1.info($i);""",filename: "test.js");
    var result = jsengine.visitProgram(program2);
    print('$i ${result?.valueOf}');
  }

}
4
likes
30
pub points
0%
popularity

Publisher

unverified uploader

JS engine for Dart.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

jsparser, symbol_table

More

Packages that depend on jsengine