示例#1
0
 protected override void OnBeforeInitializing(IList <RuntimeObject> moduleObjects)
 {
     moduleObjects[(int)WellKnownObject.ObjectPrototype]  = RuntimeObject.Create(null);
     moduleObjects[(int)WellKnownObject.NumberPrototype]  = new PrimitiveObject(0, WellKnownObject.ObjectPrototype);
     moduleObjects[(int)WellKnownObject.StringPrototype]  = new PrimitiveObject("", WellKnownObject.ObjectPrototype);
     moduleObjects[(int)WellKnownObject.BooleanPrototype] = new PrimitiveObject(false, WellKnownObject.ObjectPrototype);
     moduleObjects[(int)WellKnownObject.ArrayPrototype]   = new EcmaArray(WellKnownObject.ObjectPrototype);
 }
示例#2
0
 internal void Init(GeneratorDelegate generator)
 {
     Guard.ArgumentNotNull(generator, "generator");
     this.generator = generator;
     this.Source    = "async function* () { [native code] }";
     this.DefinePropertyOrThrow(WellKnownProperty.Prototype, new EcmaPropertyDescriptor(RuntimeObject.Create(this.Realm.GetRuntimeObject(WellKnownObject.AsyncGeneratorPrototype)), EcmaPropertyAttributes.Writable));
 }