void fx_TypedArray_prototype_subarray(txMachine* the)
{
	txSlot* instance = fxCheckTypedArrayInstance(the, mxThis);
	txSlot* dispatch = instance->next;
	txSlot* view = dispatch->next;
	txSlot* buffer = view->next;
	txU2 shift = dispatch->value.typedArray.dispatch->shift;
	txInteger length = fxGetDataViewSize(the, view, buffer) >> shift;
	txInteger start = (txInteger)fxArgToIndex(the, 0, 0, length);
	txInteger stop = (txInteger)fxArgToIndex(the, 1, length, length);
	if (stop < start) 
		stop = start;
	fxCreateTypedArraySpecies(the);
	mxPushSlot(buffer);
	mxPushInteger(view->value.dataView.offset + (start << shift));
	mxPushInteger(stop - start);
	mxRunCount(3);
	mxPullSlot(mxResult);
	fxCheckTypedArrayInstance(the, mxResult);
}
void fx_TypedArray_prototype_subarray(txMachine* the)
{
	txSlot* instance = fxCheckTypedArrayInstance(the, mxThis);
	txSlot* dispatch = instance->next;
	txSlot* view = dispatch->next;
	txSlot* buffer = view->next;
	txU2 shift = dispatch->value.typedArray.dispatch->shift;
	txInteger length = fxGetDataViewSize(the, view, buffer) >> shift;
	txInteger start = (txInteger)fxArgToIndex(the, 0, 0, length);
	txInteger stop = (txInteger)fxArgToIndex(the, 1, length, length);
	if (stop < start) 
		stop = start;
	fxCreateTypedArraySpecies(the);
	mxPushSlot(buffer);
	mxPushInteger(view->value.dataView.offset + (start << shift));
	mxPushInteger(stop - start);
	mxRunCount(3);
	mxPullSlot(mxResult);
	fxCheckTypedArrayInstance(the, mxResult);
}