Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Problem using gauss with NODE_MODULE_CONTEXTS=0 #6

@rafaparafernalia

Description

@rafaparafernalia

Hello,

I am using your library and I detected a problem. When I use your library in a file, it automatically modify the prototype of built-in Array object, without my permission ;)

I was researching and I found that the problem is that NODE_MODULE_CONTEXTS is zero for default so, your library overwrite Array built-in.

If you put the following content in a file, for example prueba.js:
var gauss = require("gauss");

var arreglo=[1,2];
for(var i in arreglo){
console.log(i);
}

You will see that shows the properties that you add to Array. If you put the lines in the REPL, the program will be ok, this happen because the variable NODE_MODULE_CONTEXTS is set different in both cases. See: nodejs/node-v0.x-archive#771

I fixed the problem adding,
In vector.js, line 6:
var Array=function () {};

In timeseries.js, line 6:
var Array = require('./vector');

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions