mirror of
				https://github.com/flynx/object.js.git
				synced 2025-10-31 03:20:09 +00:00 
			
		
		
		
	tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									3bfd570662
								
							
						
					
					
						commit
						664cd96908
					
				
							
								
								
									
										21
									
								
								object.js
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								object.js
									
									
									
									
									
								
							| @ -274,10 +274,19 @@ BOOTSTRAP(function(){ | |||||||
| 
 | 
 | ||||||
| 	// Error with some JS quirks fixed...
 | 	// Error with some JS quirks fixed...
 | ||||||
| 	//
 | 	//
 | ||||||
|  | 	// XXX EXPERIMENTAL
 | ||||||
| 	module.Error = | 	module.Error = | ||||||
| 	Constructor('Error', Error, { | 	Constructor('Error', Error, { | ||||||
| 		get name(){ | 		get name(){ | ||||||
| 			return this.constructor.name }, | 			return this.constructor.name }, | ||||||
|  | 
 | ||||||
|  | 		// XXX BUG? is this an error that with this everything seems to work
 | ||||||
|  | 		// 		while without this instances of this work fine while instances 
 | ||||||
|  | 		// 		of "sub-classes" do not set the .stack correctly???
 | ||||||
|  | 		// 		...is this a JS quirk or am I missing something???
 | ||||||
|  | 		__new__: function(context, ...args){ | ||||||
|  | 			return Reflect.construct(module.Error.__proto__, args, this.constructor) }, | ||||||
|  | 			//return Reflect.construct(Error, args, this.constructor) },
 | ||||||
| 	}) | 	}) | ||||||
| 
 | 
 | ||||||
| }) | }) | ||||||
| @ -286,18 +295,10 @@ BOOTSTRAP(function(){ | |||||||
| //---------------------------------------------------------------------
 | //---------------------------------------------------------------------
 | ||||||
| // Prototype chain content access...
 | // Prototype chain content access...
 | ||||||
| 
 | 
 | ||||||
| // Value trigger iteration stop and to carry results...
 |  | ||||||
| //
 |  | ||||||
| // NOTE: we need Constructor(..) to make this so will deffer this to the 
 |  | ||||||
| // 		end...
 |  | ||||||
| //
 |  | ||||||
| // XXX should we unify this and how types.js/Array does things with 
 |  | ||||||
| // 		StopTteration???
 |  | ||||||
| // 		...I'm not sure I like the StopIteration approach as adding a 
 |  | ||||||
| // 		try/catch block and rethrowing excptions masks their origin and 
 |  | ||||||
| // 		context and makes things harder when tracking down errors...
 |  | ||||||
| BOOTSTRAP(function(){ | BOOTSTRAP(function(){ | ||||||
| 
 | 
 | ||||||
|  | 	// Value trigger iteration stop and to carry results...
 | ||||||
|  | 	//
 | ||||||
| 	module.STOP =  | 	module.STOP =  | ||||||
| 	Constructor('STOP', { | 	Constructor('STOP', { | ||||||
| 		doc: 'stop iteration.', | 		doc: 'stop iteration.', | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "ig-object", |   "name": "ig-object", | ||||||
|   "version": "5.4.14", |   "version": "5.4.15", | ||||||
|   "description": "", |   "description": "", | ||||||
|   "main": "object.js", |   "main": "object.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user