void fxConstructArrayBufferResult(txMachine* the, txSlot* constructor, txInteger length)
{
	txSlot* instance;
	if (constructor)
		mxPushSlot(constructor);
	else {
		mxPushSlot(mxThis);
		mxGetID(mxID(_constructor));
	}
	fxToSpeciesConstructor(the, &mxArrayBufferConstructor);
	mxNew();
	mxPushInteger(length);
	mxRunCount(1);
	if (the->stack->kind != XS_REFERENCE_KIND)
		mxTypeError("no instance");
	instance = the->stack->value.reference;
	if (!(instance->next) || (instance->next->kind != XS_ARRAY_BUFFER_KIND))
		mxTypeError("no ArrayBuffer instance");
	if (!constructor && (mxThis->value.reference == instance))
		mxTypeError("same ArrayBuffer instance");
	if (instance->next->next->value.bufferInfo.length < length)
		mxTypeError("smaller ArrayBuffer instance");
	mxPullSlot(mxResult);
}
void fxConstructArrayBufferResult(txMachine* the, txSlot* constructor, txInteger length)
{
	txSlot* instance;
	if (constructor)
		mxPushSlot(constructor);
	else {
		mxPushSlot(mxThis);
		mxGetID(mxID(_constructor));
	}
	fxToSpeciesConstructor(the, &mxArrayBufferConstructor);
	mxNew();
	mxPushInteger(length);
	mxRunCount(1);
	if (the->stack->kind != XS_REFERENCE_KIND)
		mxTypeError("no instance");
	instance = the->stack->value.reference;
	if (!(instance->next) || (instance->next->kind != XS_ARRAY_BUFFER_KIND))
		mxTypeError("no ArrayBuffer instance");
	if (!constructor && (mxThis->value.reference == instance))
		mxTypeError("same ArrayBuffer instance");
	if (instance->next->next->value.bufferInfo.length < length)
		mxTypeError("smaller ArrayBuffer instance");
	mxPullSlot(mxResult);
}