From 500bca4457bb4dfbcca05ebd43924d6297977178 Mon Sep 17 00:00:00 2001 From: Junseo Yoo Date: Thu, 18 Jul 2024 02:12:18 -0700 Subject: [PATCH] information about pass by reference and typelib.copy() method --- docs/user-defined-type-functions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user-defined-type-functions.md b/docs/user-defined-type-functions.md index fddbb04..fd66df3 100644 --- a/docs/user-defined-type-functions.md +++ b/docs/user-defined-type-functions.md @@ -78,7 +78,7 @@ To allow Luau developers to modify the runtime values of types in type functions Methods under a different type heading (ex: `Singleton`) imply that the methods are only available for those types. At the implementation level, there is a check to make sure that the type-specific methods are being called on the correct types. For instance, `getindexer()` asserts that `istable()` is true. #### typelib -All attributes of newly created typelib are initialized with empty tables / arrays and `typelib.nil`. For instance, `typelib.newtable()` initializes its properties with an empty table and index / index result type as `typelib.nil`. +All attributes of newly created typelib are initialized with empty tables / arrays and `nil`. For instance, `typelib.newtable()` initializes its properties with an empty table and index / index result type as `nil`. Additionally, all arguments are passed by references. | Instance Attributes | Type | Description | | ------------- | ------------- | ------------- | @@ -121,6 +121,7 @@ All attributes of newly created typelib are initialized with empty tables / arra | `ismetatable(arg: typelib)` | `boolean` | returns true if the argument is syntactically a runtime representation of a metatable represented as a special property of the `table` type | | `isfunction(arg: typelib)` | `boolean` | returns true if the argument is syntactically a runtime representation of a `function` type | | `isclass(arg: typelib)` | `boolean` | returns true if the argument is syntactically a runtime representation of a `class` type | +| `copy(arg: typelib)` | `typelib` | returns a deep copy of the argument | #### Negation