Bug #99

avatar

instanceof across module boundaries

Added by Ash Berlin 361 days ago. Updated 348 days ago.

Status:Closed Start:09/13/2009
Priority:Urgent Due date:
Assigned to:avatarAsh Berlin % Done:

100%

Category:Core
Target version:0.8
Severity:

Normal


Description

So due to the way we try to sandbox modules from each other, instance of doesn't work across module boundaries. The 3 files attached show this problem. The interesting part is

exports.test_InstanceOf = function () {
  var a1 = require('a1');
  var a2 = require('a2');
  asserts.instanceOf(a1.array(), Array, "Array in a1 is instanceof main Array");
  asserts.instanceOf(a2.array(), Array, "Array in a2 is instanceof main Array");
  asserts.instanceOf([1,2,3], Array, "sanity check");
}

The .array() functions are defined in the moudles and return [1,2,3]. Only the sanity check test of the 3 above passes.

modules.js - test/js/modules.js (15.6 KB) Ash Berlin, 09/13/2009 06:47 PM

a1.js - test/js/lib/modules-test/a1.js (177 Bytes) Ash Berlin, 09/13/2009 06:47 PM

a2.js - test/js/lib/modules-test/a2.js (146 Bytes) Ash Berlin, 09/13/2009 06:47 PM

History

Updated by Ash Berlin 348 days ago

avatar
  • % Done changed from 0 to 100
  • Status changed from New to Closed

module_scope branch was just merged back to master with fixes for this.

Also available in: Atom PDF