Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engine/source/dmdscript/darguments.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Darguments : Dobject
Identifier *[] parameters, Value[] arglist)

{
super(cc, Dobject.getPrototype());
super(cc, Dobject.getPrototype(cc));

this.actobj = actobj;
this.parameters = parameters;
Expand Down
24 changes: 12 additions & 12 deletions engine/source/dmdscript/darray.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DarrayConstructor : Dfunction
{
this(CallContext* cc)
{
super(cc, 1, Dfunction_prototype);
super(cc, 1, cc.tc.Dfunction_prototype);
name = "Array";
}

Expand Down Expand Up @@ -951,10 +951,10 @@ class DarrayPrototype : Darray
{
this(CallContext* cc)
{
super(cc, Dobject_prototype);
Dobject f = Dfunction_prototype;
super(cc, cc.tc.Dobject_prototype);
Dobject f = cc.tc.Dfunction_prototype;

Put(cc, TEXT_constructor, Darray_constructor, DontEnum);
Put(cc, TEXT_constructor, cc.tc.Darray_constructor, DontEnum);

static enum NativeFunctionData[] nfd =
[
Expand Down Expand Up @@ -987,7 +987,7 @@ class Darray : Dobject

this(CallContext* cc)
{
this(cc, getPrototype());
this(cc, getPrototype(cc));
}

this(CallContext* cc, Dobject prototype)
Expand Down Expand Up @@ -1193,22 +1193,22 @@ class Darray : Dobject
}


static Dfunction getConstructor()
static Dfunction getConstructor(CallContext* cc)
{
return Darray_constructor;
return cc.tc.Darray_constructor;
}

static Dobject getPrototype()
static Dobject getPrototype(CallContext* cc)
{
return Darray_prototype;
return cc.tc.Darray_prototype;
}

static void initialize(CallContext* cc)
{
Darray_constructor = new DarrayConstructor(cc);
Darray_prototype = new DarrayPrototype(cc);
cc.tc.Darray_constructor = new DarrayConstructor(cc);
cc.tc.Darray_prototype = new DarrayPrototype(cc);

Darray_constructor.Put(cc, TEXT_prototype, Darray_prototype, DontEnum | ReadOnly);
cc.tc.Darray_constructor.Put(cc, TEXT_prototype, cc.tc.Darray_prototype, DontEnum | ReadOnly);
}
}

22 changes: 11 additions & 11 deletions engine/source/dmdscript/dboolean.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DbooleanConstructor : Dfunction
{
this(CallContext* cc)
{
super(cc, 1, Dfunction_prototype);
super(cc, 1, cc.tc.Dfunction_prototype);
name = "Boolean";
}

Expand Down Expand Up @@ -118,10 +118,10 @@ class DbooleanPrototype : Dboolean
{
this(CallContext* cc)
{
super(cc, Dobject_prototype);
super(cc, cc.tc.Dobject_prototype);
//Dobject f = Dfunction_prototype;

Put(cc, TEXT_constructor, Dboolean_constructor, DontEnum);
Put(cc, TEXT_constructor, cc.tc.Dboolean_constructor, DontEnum);

static enum NativeFunctionData[] nfd =
[
Expand All @@ -140,7 +140,7 @@ class Dboolean : Dobject
{
this(CallContext* cc, d_boolean b)
{
super(cc, Dboolean.getPrototype());
super(cc, Dboolean.getPrototype(cc));
value.putVboolean(b);
classname = TEXT_Boolean;
}
Expand All @@ -152,22 +152,22 @@ class Dboolean : Dobject
classname = TEXT_Boolean;
}

static Dfunction getConstructor()
static Dfunction getConstructor(CallContext* cc)
{
return Dboolean_constructor;
return cc.tc.Dboolean_constructor;
}

static Dobject getPrototype()
static Dobject getPrototype(CallContext* cc)
{
return Dboolean_prototype;
return cc.tc.Dboolean_prototype;
}

static void initialize(CallContext* cc)
{
Dboolean_constructor = new DbooleanConstructor(cc);
Dboolean_prototype = new DbooleanPrototype(cc);
cc.tc.Dboolean_constructor = new DbooleanConstructor(cc);
cc.tc.Dboolean_prototype = new DbooleanPrototype(cc);

Dboolean_constructor.Put(cc, TEXT_prototype, Dboolean_prototype, DontEnum | DontDelete | ReadOnly);
cc.tc.Dboolean_constructor.Put(cc, TEXT_prototype, cc.tc.Dboolean_prototype, DontEnum | DontDelete | ReadOnly);
}
}

28 changes: 14 additions & 14 deletions engine/source/dmdscript/ddate.d
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class DdateConstructor : Dfunction
{
this(CallContext* cc)
{
super(cc, 7, Dfunction_prototype);
super(cc, 7, cc.tc.Dfunction_prototype);
name = "Date";

static enum NativeFunctionData[] nfd =
Expand Down Expand Up @@ -1442,11 +1442,11 @@ class DdatePrototype : Ddate
{
this(CallContext* cc)
{
super(cc, Dobject_prototype);
super(cc, cc.tc.Dobject_prototype);

Dobject f = Dfunction_prototype;
Dobject f = cc.tc.Dfunction_prototype;

Put(cc, TEXT_constructor, Ddate_constructor, DontEnum);
Put(cc, TEXT_constructor, cc.tc.Ddate_constructor, DontEnum);

static enum NativeFunctionData[] nfd =
[
Expand Down Expand Up @@ -1511,14 +1511,14 @@ class Ddate : Dobject
{
this(CallContext* cc, d_number n)
{
super(cc, Ddate.getPrototype());
super(cc, Ddate.getPrototype(cc));
classname = TEXT_Date;
value.putVnumber(n);
}

this(CallContext* cc, d_time n)
{
super(cc, Ddate.getPrototype());
super(cc, Ddate.getPrototype(cc));
classname = TEXT_Date;
value.putVtime(n);
}
Expand All @@ -1532,23 +1532,23 @@ class Ddate : Dobject

static void initialize(CallContext* cc)
{
Ddate_constructor = new DdateConstructor(cc);
Ddate_prototype = new DdatePrototype(cc);
cc.tc.Ddate_constructor = new DdateConstructor(cc);
cc.tc.Ddate_prototype = new DdatePrototype(cc);

Ddate_constructor.Put(cc, TEXT_prototype, Ddate_prototype,
cc.tc.Ddate_constructor.Put(cc, TEXT_prototype, cc.tc.Ddate_prototype,
DontEnum | DontDelete | ReadOnly);

assert(Ddate_prototype.proptable.table.length != 0);
assert(cc.tc.Ddate_prototype.proptable.table.length != 0);
}

static Dfunction getConstructor()
static Dfunction getConstructor(CallContext* cc)
{
return Ddate_constructor;
return cc.tc.Ddate_constructor;
}

static Dobject getPrototype()
static Dobject getPrototype(CallContext* cc)
{
return Ddate_prototype;
return cc.tc.Ddate_prototype;
}
}

Expand Down
8 changes: 4 additions & 4 deletions engine/source/dmdscript/ddeclaredfunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class DdeclaredFunction : Dfunction

this(CallContext* cc, FunctionDefinition fd)
{
super(cc, cast(uint)fd.parameters.length, Dfunction.getPrototype());
assert(Dfunction.getPrototype());
super(cc, cast(uint)fd.parameters.length, Dfunction.getPrototype(cc));
assert(Dfunction.getPrototype(cc));
assert(internal_prototype);
this.fd = fd;

Dobject o;

// ECMA 3 13.2
o = new Dobject(cc, Dobject.getPrototype()); // step 9
o = new Dobject(cc, Dobject.getPrototype(cc)); // step 9
Put(cc, TEXT_prototype, o, DontEnum); // step 11
o.Put(cc, TEXT_constructor, this, DontEnum); // step 10
}
Expand Down Expand Up @@ -193,7 +193,7 @@ class DdeclaredFunction : Dfunction

v = Get(TEXT_prototype);
if(v.isPrimitive())
proto = Dobject.getPrototype();
proto = Dobject.getPrototype(cc);
else
proto = v.toObject(cc);
othis = new Dobject(cc, proto);
Expand Down
24 changes: 12 additions & 12 deletions engine/source/dmdscript/derror.d
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DerrorConstructor : Dfunction
{
this(CallContext* cc)
{
super(cc, 1, Dfunction_prototype);
super(cc, 1, cc.tc.Dfunction_prototype);
}

override void* Construct(CallContext *cc, Value *ret, Value[] arglist)
Expand Down Expand Up @@ -104,11 +104,11 @@ class DerrorPrototype : Derror
{
this(CallContext* cc)
{
super(cc, Dobject_prototype);
Dobject f = Dfunction_prototype;
super(cc, cc.tc.Dobject_prototype);
Dobject f = cc.tc.Dfunction_prototype;
//d_string m = d_string_ctor(DTEXT("Error.prototype.message"));

Put(cc, TEXT_constructor, Derror_constructor, DontEnum);
Put(cc, TEXT_constructor, cc.tc.Derror_constructor, DontEnum);

static enum NativeFunctionData[] nfd =
[
Expand All @@ -131,7 +131,7 @@ class Derror : Dobject
{
this(CallContext* cc, Value * m, Value * v2)
{
super(cc, getPrototype());
super(cc, getPrototype(cc));
classname = TEXT_Error;

immutable(char)[] msg;
Expand Down Expand Up @@ -166,22 +166,22 @@ class Derror : Dobject
classname = TEXT_Error;
}

static Dfunction getConstructor()
static Dfunction getConstructor(CallContext* cc)
{
return Derror_constructor;
return cc.tc.Derror_constructor;
}

static Dobject getPrototype()
static Dobject getPrototype(CallContext* cc)
{
return Derror_prototype;
return cc.tc.Derror_prototype;
}

static void initialize(CallContext* cc)
{
Derror_constructor = new DerrorConstructor(cc);
Derror_prototype = new DerrorPrototype(cc);
cc.tc.Derror_constructor = new DerrorConstructor(cc);
cc.tc.Derror_prototype = new DerrorPrototype(cc);

Derror_constructor.Put(cc, TEXT_prototype, Derror_prototype, DontEnum | DontDelete | ReadOnly);
cc.tc.Derror_constructor.Put(cc, TEXT_prototype, cc.tc.Derror_prototype, DontEnum | DontDelete | ReadOnly);
}
}

26 changes: 13 additions & 13 deletions engine/source/dmdscript/dfunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DfunctionConstructor : Dfunction
{
this(CallContext* cc)
{
super(cc, 1, Dfunction_prototype);
super(cc, 1, cc.tc.Dfunction_prototype);

// Actually put in later by Dfunction::initialize()
//unsigned attributes = DontEnum | DontDelete | ReadOnly;
Expand Down Expand Up @@ -261,13 +261,13 @@ class DfunctionPrototype : Dfunction
{
this(CallContext* cc)
{
super(cc, 0, Dobject_prototype);
super(cc, 0, cc.tc.Dobject_prototype);

uint attributes = DontEnum;

classname = TEXT_Function;
name = "prototype";
Put(cc, TEXT_constructor, Dfunction_constructor, attributes);
Put(cc, TEXT_constructor, cc.tc.Dfunction_constructor, attributes);

static enum NativeFunctionData[] nfd =
[
Expand Down Expand Up @@ -297,7 +297,7 @@ class Dfunction : Dobject

this(CallContext* cc, d_uint32 length)
{
this(cc, length, Dfunction.getPrototype());
this(cc, length, Dfunction.getPrototype(cc));
}

this(CallContext* cc, d_uint32 length, Dobject prototype)
Expand Down Expand Up @@ -375,24 +375,24 @@ class Dfunction : Dobject
}


static Dfunction getConstructor()
static Dfunction getConstructor(CallContext* cc)
{
return Dfunction_constructor;
return cc.tc.Dfunction_constructor;
}

static Dobject getPrototype()
static Dobject getPrototype(CallContext* cc)
{
return Dfunction_prototype;
return cc.tc.Dfunction_prototype;
}

static void initialize(CallContext* cc)
{
Dfunction_constructor = new DfunctionConstructor(cc);
Dfunction_prototype = new DfunctionPrototype(cc);
cc.tc.Dfunction_constructor = new DfunctionConstructor(cc);
cc.tc.Dfunction_prototype = new DfunctionPrototype(cc);

Dfunction_constructor.Put(cc, TEXT_prototype, Dfunction_prototype, DontEnum | DontDelete | ReadOnly);
cc.tc.Dfunction_constructor.Put(cc, TEXT_prototype, cc.tc.Dfunction_prototype, DontEnum | DontDelete | ReadOnly);

Dfunction_constructor.internal_prototype = Dfunction_prototype;
Dfunction_constructor.proptable.previous = Dfunction_prototype.proptable;
cc.tc.Dfunction_constructor.internal_prototype = cc.tc.Dfunction_prototype;
cc.tc.Dfunction_constructor.proptable.previous = cc.tc.Dfunction_prototype.proptable;
}
}
Loading