-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00d6294
commit 4fa6f16
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @file Object Class definition | ||
* @since 0.2.9 | ||
*/ | ||
/*#ifndef(UMD)*/ | ||
"use strict"; | ||
/*global _GpfClassDefinition*/ // Class definition | ||
/*global _gpfDefineClassImported*/ // Base dictionary for all imported classes | ||
/*global _gpfDefineEntitiesAdd*/ // Store the entity definition to be retreived later | ||
/*global _gpfObjectForEach*/ // Similar to [].forEach but for objects | ||
/*#endif*/ | ||
|
||
function _gpfDefineClassStandardGetDictionary (name) { | ||
return Object.assign(Object.create(_gpfDefineClassImported), { | ||
$name: name | ||
}); | ||
} | ||
|
||
function _gpfDefineClassStandardBuildEntityDefinition (InstanceBuilder, name) { | ||
return Object.assign(new _GpfClassDefinition(_gpfDefineClassStandardGetDictionary(name)), { | ||
_instanceBuilder: InstanceBuilder | ||
}); | ||
} | ||
|
||
function _gpfDefineClassStandardPatchDefinition (entityDefinition) { | ||
Object.assign(entityDefinition, { | ||
_extend: null, | ||
_extendDefinition: null | ||
}); | ||
} | ||
|
||
function _gpfDefineClassStandardInstallEntityDefinition (InstanceBuilder, name) { | ||
var entityDefinition = _gpfDefineClassStandardBuildEntityDefinition(InstanceBuilder, name); | ||
_gpfDefineEntitiesAdd(entityDefinition); | ||
entityDefinition.check(); | ||
_gpfDefineClassStandardPatchDefinition(entityDefinition); | ||
} | ||
|
||
_gpfDefineClassStandardInstallEntityDefinition(Object, "Object"); | ||
_gpfObjectForEach({ | ||
"Array": Array, | ||
"Date": Date, | ||
"Error": Error, | ||
"Function": Function, | ||
"Number": Number, | ||
"RegExp": RegExp, | ||
"String": String | ||
}, _gpfDefineClassStandardInstallEntityDefinition); |