Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 876a3c0

Browse files
chirayukjuliemr
authored andcommitted
feat(runner): support running dart2js spec files
This commit supports running Dart2JS output in NodeJS. Officially, Dart2JS in supposed to only generate code for running in a real webbrowser. With this patch, the dart2js code can also be executed in NodeJS. Ref: https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/sdk/lib/js/dart2js/js_dart2js.dart?spec=svn32943&r=32943#487
1 parent 56daa54 commit 876a3c0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/runner.js

+3
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ Runner.prototype.setupGlobals_ = function(driver) {
352352

353353
// Enable sourcemap support for stack traces.
354354
require('source-map-support').install();
355+
// Required by dart2js machinery.
356+
// https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/sdk/lib/js/dart2js/js_dart2js.dart?spec=svn32943&r=32943#487
357+
global.DartObject = function(o) { this.o = o; };
355358
};
356359

357360
/**

spec/basic/lib_spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ describe('protractor library', function() {
1414
expect(By).toBeDefined();
1515
expect(element).toBeDefined();
1616
expect($).toBeDefined();
17+
expect(DartObject).toBeDefined();
18+
var obj = {};
19+
var dartProxy = new DartObject(obj);
20+
expect(dartProxy.o === obj).toBe(true);
1721
});
1822

1923
it('should export other webdriver classes onto the global protractor',

0 commit comments

Comments
 (0)