-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathObject.js
More file actions
26 lines (23 loc) · 1011 Bytes
/
Object.js
File metadata and controls
26 lines (23 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#if COPYRIGHT
//------------------------------------------------------------------------------
// <copyright file="Object.js" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
#endif
Object.__typeName = 'Object';
Object.__class = true;
Object.getType = function(instance) {
/// <param name="instance">The object for which the type must be returned.</param>
/// <returns type="Type">The type of the object.</returns>
var ctor = instance.constructor;
if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) {
return Object;
}
return ctor;
}
Object.getTypeName = function(instance) {
/// <param name="instance">The object for which the type name must be returned.</param>
/// <returns type="String">The name of the type of the object.</returns>
return Object.getType(instance).getName();
}