// 2. If func is an Object, func has a [[SourceText]] internal slot, func.[[SourceText]] is a sequence of Unicode code points,and HostHasSourceTextAvailable(func) is true, then
// a. Return CodePointsToString(func.[[SourceText]]).
// TODO:
// 2. If func is an Object, func has a [[SourceText]] internal slot, func.[[SourceText]] is a sequence of Unicode code points,and HostHasSourceTextAvailable(func) is true, then
// a. Return CodePointsToString(func.[[SourceText]]).
// 3. If func is a built-in function object, return an implementation-defined String source code representation of func.
// The representation must have the syntax of a NativeFunction. Additionally, if func has an [[InitialName]] internal slot and
@ -859,11 +868,12 @@ impl BuiltInFunctionObject {
// 4. If func is an Object and IsCallable(func) is true, return an implementation-defined String source code representation of func.
// The representation must have the syntax of a NativeFunction.
// 5. Throw a TypeError exception.
letSome(object)=func.as_object()else{
letSome(object)=func.as_callable()else{
returnErr(JsNativeError::typ().with_message("not a function").into());
};
ifobject.borrow().is_native_function(){
letobject=object.borrow();
ifobject.is_native_function(){
letname={
// Is there a case here where if there is no name field on a value
// name should default to None? Do all functions have names set?